-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathgulpfile.js
39 lines (35 loc) · 999 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
37
38
39
var path = require('path')
var gulp = require('gulp')
var webpack = require('gulp-webpack')
var rename = require('gulp-rename')
gulp.task('webpack', function () {
var sourceFiles = path.resolve(__dirname, 'src')
var input = path.resolve(sourceFiles, 'pixi-svg-graphics.js')
return gulp.src(input)
.pipe(webpack({
context: sourceFiles,
output: {
library: 'SVGGraphics',
libraryTarget: 'umd',
filename: 'pixi-svg-graphics.js',
path: path.resolve(__dirname, 'dist')
},
resolve: {
extensions: ['', '.js'],
root: sourceFiles
},
externals: {
'pixi.js': {
root: 'PIXI',
commonjs: 'pixi.js',
commonjs2: 'pixi.js',
amd: 'pixi.js'
}
}
}))
.pipe(gulp.dest(path.resolve(__dirname, 'dist')))
})
gulp.task('watch', function() {
gulp.watch('src/pixi-svg-graphics.js', gulp.series(['webpack']))
})
gulp.task('default', gulp.series(['webpack']))