Uh oh!
There was an error while loading. Please reload this page.
forked from myagoo/angular-memory-stats
- Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgulpfile.js
More file actions
Latest commit
46 lines (42 loc) · 1.43 KB
/
Copy pathgulpfile.js
File metadata and controls
46 lines (42 loc) · 1.43 KB
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
vargulp=require('gulp'),
path=require('path'),
header=require('gulp-header'),
webpack=require('webpack'),
gulpWebpack=require('gulp-webpack'),
extend=require('util')._extend,
pkg=require('./package.json'),
clone=require('clone'),
distPath=path.join(__dirname,'dist'),
webpackBuildConfig=require("./webpack.config.build");
varbanner=['/**',
' * <%= pkg.name %> - <%= pkg.description %>',
' * @version v<%= pkg.version %>',
' * @author <%= pkg.author %>',
' * @link <%= pkg.homepage %>',
' * @license <%= pkg.license %>',
' */',
''
].join('\n');
gulp.task('default',['build']);
gulp.task('build',['build:dev','build:prod']);
gulp.task("build:dev",function(callback){
varwebpackConfig=clone(webpackBuildConfig);
webpackConfig.output.filename=pkg.name+'.js';
returngulp.src(webpackConfig.entry)
.pipe(gulpWebpack(webpackConfig))
.pipe(header(banner,{
pkg: pkg
}))
.pipe(gulp.dest(distPath));
});
gulp.task("build:prod",function(callback){
varwebpackConfig=clone(webpackBuildConfig);
webpackConfig.output.filename=pkg.name+'.min.js';
webpackConfig.plugins.push(newwebpack.optimize.UglifyJsPlugin());
returngulp.src(webpackConfig.entry)
.pipe(gulpWebpack(webpackConfig))
.pipe(header(banner,{
pkg: pkg
}))
.pipe(gulp.dest(distPath));
});