-
Notifications
You must be signed in to change notification settings - Fork 28
/
gulpfile.js
36 lines (33 loc) · 841 Bytes
/
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
const gulp = require('gulp')
const gutil = require('gulp-util')
const webpack = require('webpack')
const path = require('path')
gulp.task('cjs', function (callback) {
var myConfig = {
entry: {
preload: './src/cscripts/index.js'
},
output: {
path: path.join(__dirname, './public/js'),
publicPath: './public/js',
filename: 'cjs.js'
}
}
// run webpack
webpack(myConfig, function (err, stats) {
if (err) throw new gutil.PluginError('webpack', err)
gutil.log('[webpack]', stats.toString({
colors: true,
progress: true
}))
callback()
})
})
gulp.task('public-image', function () {
gulp.src([
'./src/assets/img/**/*.jpg',
'./src/assets/img/**/*.png',
'./src/assets/img/**/*.gif',
'./src/assets/img/**/*.svg'])
.pipe(gulp.dest('./public/img'))
})