forked from hezhii/poppy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
38 lines (33 loc) · 859 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
const gulp = require('gulp');
const webpack = require('webpack');
const zip = require('gulp-zip');
const webpackConfig = require('./build/webpack.prod');
gulp.task('webpack', (callback) => {
webpack(webpackConfig, (err, stats) => {
if (err) {
throw err;
}
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false,
chunks: false,
chunkModules: false,
}) + '\n\n');
callback();
});
});
gulp.task('zip', ['webpack'], () => {
const packageJson = require('./package.json');
const filename = `${packageJson.name}-${packageJson.version}.zip`;
return gulp.src([
'**',
'!node_modules', '!node_modules/**',
'!dist', '!dist/**',
'!build', '!build/**',
'!src', '!src/**',
'!yarn.lock',
])
.pipe(zip(filename))
.pipe(gulp.dest('dist'));
});