Authored by xuqi

gulp default

1 node_modules/ 1 node_modules/
2 dist/ 2 dist/
3 npm-debug.log 3 npm-debug.log
4 -css/* 4 +public/css/*
5 public/bundle/* 5 public/bundle/*
@@ -112,7 +112,7 @@ gulp.task('default', ['postcss-dev', 'postcss-watch', 'webpack-dev-server']); @@ -112,7 +112,7 @@ gulp.task('default', ['postcss-dev', 'postcss-watch', 'webpack-dev-server']);
112 gulp.task('postcss-dev', () => { 112 gulp.task('postcss-dev', () => {
113 return gulp.src('scss/index.css') 113 return gulp.src('scss/index.css')
114 .pipe(sourcemaps.init()) 114 .pipe(sourcemaps.init())
115 - .pipe(postcssPlugin(env.dev)) 115 + .pipe(postcss(postcssPlugin(env.dev)))
116 .pipe(sourcemaps.write('.')) 116 .pipe(sourcemaps.write('.'))
117 .pipe(gulp.dest('css/')); 117 .pipe(gulp.dest('css/'));
118 }); 118 });
@@ -140,7 +140,7 @@ gulp.task('font', () => { @@ -140,7 +140,7 @@ gulp.task('font', () => {
140 // postcss compile in pro 140 // postcss compile in pro
141 gulp.task('postcss', ['assets'], () => { 141 gulp.task('postcss', ['assets'], () => {
142 return gulp.src('scss/index.css') 142 return gulp.src('scss/index.css')
143 - .pipe(postcssPlugin(env.pro)) 143 + .pipe(postcss(postcssPlugin(env.pro)))
144 .pipe(cssnano()) 144 .pipe(cssnano())
145 .pipe(gulp.dest(dist.css)); 145 .pipe(gulp.dest(dist.css));
146 }); 146 });
@@ -168,7 +168,10 @@ gulp.task('webpack-dev-server', () => { @@ -168,7 +168,10 @@ gulp.task('webpack-dev-server', () => {
168 168
169 // webpack compile in pro 169 // webpack compile in pro
170 gulp.task('webpack', () => { 170 gulp.task('webpack', () => {
171 - webpack(webpackConfig, (err, stats) => { 171 + var proConfig = Object.assign({}, webpackConfig);
  172 +
  173 + proConfig.output.path = dist.js;
  174 + webpack(proConfig, (err, stats) => {
172 if (err) { 175 if (err) {
173 throw new gutil.PluginError('webpack', err); 176 throw new gutil.PluginError('webpack', err);
174 } 177 }