...
|
...
|
@@ -105,6 +105,9 @@ const postcssPlugin = (et) => { |
|
|
return plugins;
|
|
|
};
|
|
|
|
|
|
// default
|
|
|
gulp.task('default', ['postcss-dev', 'postcss-watch', 'webpack-dev-server']);
|
|
|
|
|
|
// postcss compile in dev
|
|
|
gulp.task('postcss-dev', () => {
|
|
|
return gulp.src('scss/index.css')
|
...
|
...
|
@@ -143,25 +146,25 @@ gulp.task('postcss', ['assets'], () => { |
|
|
});
|
|
|
|
|
|
// webpack dev server
|
|
|
// gulp.task('webpack-dev-server', () => {
|
|
|
// var devConfig = Object.assign({}, webpackConfig, {
|
|
|
// devtool: 'eval',
|
|
|
// debug: true
|
|
|
// });
|
|
|
|
|
|
// new webpackDevServer(webpack(devConfig), {
|
|
|
// contentBase: '.',
|
|
|
// publicPath: '/',
|
|
|
// stats: {
|
|
|
// colors: true
|
|
|
// }
|
|
|
// }).listen(8000, 'localhost', (err) => {
|
|
|
// if (err) {
|
|
|
// throw new gutil.PluginError('webpack-dev-server', err);
|
|
|
// }
|
|
|
// gutil.log('[webpack-serve]', 'http://localhost:8000/');
|
|
|
// });
|
|
|
// });
|
|
|
gulp.task('webpack-dev-server', () => {
|
|
|
var devConfig = Object.assign({}, webpackConfig, {
|
|
|
debug: true
|
|
|
});
|
|
|
|
|
|
new webpackDevServer(webpack(devConfig), {
|
|
|
contentBase: '.',
|
|
|
publicPath: '//localhost:8000/',
|
|
|
hot: true,
|
|
|
stats: {
|
|
|
colors: true
|
|
|
}
|
|
|
}).listen(8000, 'localhost', (err) => {
|
|
|
if (err) {
|
|
|
throw new gutil.PluginError('webpack-dev-server', err);
|
|
|
}
|
|
|
gutil.log('[webpack-serve]', 'http://localhost:8000/');
|
|
|
});
|
|
|
});
|
|
|
|
|
|
// webpack compile in pro
|
|
|
gulp.task('webpack', () => {
|
...
|
...
|
|