5 changed files with 43 additions and 24 deletions
@ -0,0 +1,22 @@ |
|||||||
|
const Webpack = require('webpack'); |
||||||
|
const WebpackDevServer = require('webpack-dev-server'); |
||||||
|
const webpack_config = require('../webpack.config'); |
||||||
|
|
||||||
|
const path = require('path'); |
||||||
|
|
||||||
|
const compiler = Webpack(webpack_config); |
||||||
|
const server = new WebpackDevServer(compiler, { |
||||||
|
contentBase: webpack_config.output.path, |
||||||
|
disableHostCheck: true, |
||||||
|
stats: { |
||||||
|
colors: true |
||||||
|
}, |
||||||
|
headers: {} |
||||||
|
}); |
||||||
|
|
||||||
|
const listen_interface = "0.0.0.0"; |
||||||
|
const listen_port = 2000; |
||||||
|
|
||||||
|
server.listen(listen_port, listen_interface, () => { |
||||||
|
console.log("Starting server on " + listen_interface + ":" + listen_port"); |
||||||
|
}); |
||||||
@ -1,14 +1,15 @@ |
|||||||
import webpack from 'webpack'; |
const path = require('path'); |
||||||
|
|
||||||
export default { |
module.exports = { |
||||||
entry: '', |
entry: { |
||||||
|
'index': [ |
||||||
|
'./src', |
||||||
|
] |
||||||
|
}, |
||||||
output: { |
output: { |
||||||
path: './web/', |
path: path.resolve(__dirname,'web'), |
||||||
publicPath: '/web/', |
publicPath: '/web/', |
||||||
filename: 'js/[name].js' |
filename: 'js/[name].js' |
||||||
}, |
|
||||||
module: { |
|
||||||
{ test: /\.jsx?$/, loader: 'babel', exclude: /node_modules/ } |
|
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
|
|||||||
Loading…
Reference in new issue