...
|
...
|
@@ -203,18 +203,23 @@ gulp.task('webpack-dev-server', () => { |
|
|
}
|
|
|
});
|
|
|
|
|
|
// webpackDashboardPlugin
|
|
|
devConfig.output.publicPath = 'http://localhost:5004/';
|
|
|
|
|
|
// 开发环境插件
|
|
|
devConfig.plugins.push(new webpack.HotModuleReplacementPlugin());
|
|
|
|
|
|
if (useDashboard) {
|
|
|
const dashboard = new Dashboard();
|
|
|
const dashboard = new Dashboard(); // webpackDashboardPlugin
|
|
|
|
|
|
devConfig.plugins.push(new DashboardPlugin(dashboard.setData));
|
|
|
}
|
|
|
|
|
|
devConfig.entry.libs.unshift('webpack-dev-server/client?http://localhost:5004/');
|
|
|
devConfig.entry.libs.unshift(`webpack-dev-server/client?${devConfig.output.publicPath}`, 'webpack/hot/dev-server');
|
|
|
|
|
|
new WebpackDevServer(webpack(devConfig), {
|
|
|
contentBase: '.',
|
|
|
publicPath: '//localhost:5004/',
|
|
|
publicPath: devConfig.output.publicPath,
|
|
|
hot: true,
|
|
|
inline: true,
|
|
|
quiet: useDashboard,
|
|
|
stats: {
|
...
|
...
|
@@ -227,7 +232,7 @@ gulp.task('webpack-dev-server', () => { |
|
|
if (err) {
|
|
|
throw new gutil.PluginError('webpack-dev-server', err);
|
|
|
}
|
|
|
gutil.log('[webpack-serve]', 'http://localhost:5004/');
|
|
|
gutil.log('[webpack-serve]', devConfig.output.publicPath);
|
|
|
});
|
|
|
});
|
|
|
|
...
|
...
|
|