-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
52 lines (44 loc) · 1.29 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
'use strict';
var path = require('path');
var gulp = require('gulp');
var gulpLoadPlugins = require('gulp-load-plugins');
var webpack = require('webpack');
var webpackConfig = require('./webpack.config');
var gutil = require('gulp-util');
const $ = gulpLoadPlugins();
gulp.task('default', ['webpack']);
gulp.task('go', ['default'], function () {
gulp.watch('app/assets/styles/scss/**/*.scss', ['styles']);
gulp.watch('app/vue/**/*.*', ['webpack']);
});
gulp.task('webpack', function(callback) {
var config = Array.from(webpackConfig);
webpack(config, function(err, stats) {
if (err) throw new gutil.PluginError('webpack', err);
gutil.log("[webpack]", stats.toString({
colors: true,
//progress: true
errorDetails:true
//reasons: true,
//modules:true
}));
callback();
});
});
//gulp.task('babel', function() {
// return gulp.src(
// [
//
// ]
// )
// .pipe($.babel())
// .pipe(gulp.dest('.tmp/scripts'))
//});
//gulp.task('build', ['webpack'], function() {
// return gulp.src(['./.tmp/bundle/*.bundle.js'])
// .pipe($.sourcemaps.init())
// .pipe($.concat('main.min.js'))
// .pipe($.uglify({preserveComments: 'some'}))
// .pipe($.sourcemaps.write('.'))
// .pipe(gulp.dest('app/bundle'))
//});