Commit 1aab645f authored by wildfirecode's avatar wildfirecode

1

parent fab0afc1
......@@ -4,10 +4,21 @@ const WebpackDevServer = require('webpack-dev-server');
var serverStart = proj => {
const devConfig = getDevConfig(proj);
// 遍历每个entry,加入dev-server client
Object.keys(devConfig.entry).forEach(function(name) {
let _devServer = `webpack-dev-server/client?http://localhost:8080`;
devConfig.entry[name] = [_devServer].concat(devConfig.entry[name]);
});
console.log(devConfig.entry)
var compiler = webpack(devConfig);
const devServerOptions = {
host: '0.0.0.0',
watchContentBase: true,
contentBase: `./${proj}`,
proxy: {
'/ngapi/*': 'http://localhost:3000',
......@@ -29,6 +40,7 @@ var serverStart = proj => {
const devServer = new WebpackDevServer(compiler, devServerOptions);
devServer.listen(8080, '0.0.0.0', () => {
console.log(`Starting server ...`);
});
};
......
......@@ -2,7 +2,7 @@ const path = require('path');
module.exports = proj => {
const result = {
entry: `./${proj}/src/Main.ts`,
entry: {app:`./${proj}/src/Main.ts`},
module: {
rules: [
{
......
......@@ -13,5 +13,5 @@
"webpack-merge": "^4.1.2",
"mock-webpack-plugin": "^2.0.0"
},
"version": "0.0.3"
"version": "0.0.4"
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment