Skip to content
This repository has been archived by the owner on Oct 21, 2021. It is now read-only.

Commit

Permalink
Merge pull request #6 from lukastaegert/master
Browse files Browse the repository at this point in the history
Pass in webpack config file via command line parameter
  • Loading branch information
dtinth authored Oct 4, 2016
2 parents e4c29f9 + 7e4eb7a commit 1f52212
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
14 changes: 13 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
#!/usr/bin/env node
'use strict'

const config = require(require('path').resolve(process.cwd(), 'webpack.config.test-bed.js'))
const relativeConfigPath = require('yargs')
.option('c', {
alias: 'config',
demand: false,
default: 'webpack.config.test-bed.js',
describe: 'Specify the configuration file',
type: 'string'
})
.nargs('config', 1)
.help()
.argv.config;

const config = require(require('path').resolve(process.cwd(), relativeConfigPath))
const server = require('./createServer')(config)

server.listen(9011, function () {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"socket.io": "^1.4.6",
"style-loader": "^0.13.1",
"webpack-dev-middleware": "^1.6.1",
"webpack-hot-middleware": "^2.10.0"
"webpack-hot-middleware": "^2.10.0",
"yargs": "^5.0.0"
},
"devDependencies": {
"mocha": "^2.5.3",
Expand Down

0 comments on commit 1f52212

Please sign in to comment.