...
|
...
|
@@ -19,8 +19,6 @@ const scss = require('postcss-scss'); |
|
|
const webpack = require('webpack');
|
|
|
const WebpackDevServer = require('webpack-dev-server');
|
|
|
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
|
|
const Dashboard = require('webpack-dashboard');
|
|
|
const DashboardPlugin = require('webpack-dashboard/plugin');
|
|
|
|
|
|
const webpackConfig = require('./webpack.config.js');
|
|
|
|
...
|
...
|
@@ -193,7 +191,6 @@ gulp.task('postcss', ['assets'], () => { |
|
|
|
|
|
// webpack dev server
|
|
|
gulp.task('webpack-dev-server', () => {
|
|
|
const useDashboard = process.platform === 'darwin' || process.platform === 'linux';
|
|
|
const devConfig = Object.assign({}, webpackConfig, {
|
|
|
devtool: '#inline-source-map',
|
|
|
vue: {
|
...
|
...
|
@@ -215,12 +212,6 @@ gulp.task('webpack-dev-server', () => { |
|
|
// 开发环境插件
|
|
|
devConfig.plugins.push(new webpack.HotModuleReplacementPlugin());
|
|
|
|
|
|
if (useDashboard) {
|
|
|
const dashboard = new Dashboard(); // webpackDashboardPlugin
|
|
|
|
|
|
devConfig.plugins.push(new DashboardPlugin(dashboard.setData));
|
|
|
}
|
|
|
|
|
|
devConfig.entry.libs.unshift(`webpack-dev-server/client?${devConfig.output.publicPath}`, 'webpack/hot/dev-server');
|
|
|
|
|
|
new WebpackDevServer(webpack(devConfig), {
|
...
|
...
|
@@ -228,7 +219,7 @@ gulp.task('webpack-dev-server', () => { |
|
|
publicPath: devConfig.output.publicPath,
|
|
|
hot: true,
|
|
|
inline: true,
|
|
|
quiet: useDashboard,
|
|
|
quiet: true,
|
|
|
stats: {
|
|
|
colors: true
|
|
|
},
|
...
|
...
|
|