1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 10:19:30 +02:00

Starting to add build targets for common status page.

This commit is contained in:
Gunther Brunner 2014-06-04 18:45:11 +09:00
parent a9e2268b18
commit 1c45b6eb70
7 changed files with 43 additions and 2 deletions

View file

@ -5,6 +5,7 @@ var jsonlint = require('gulp-jsonlint')
var webpack = require('webpack')
var ngminPlugin = require('ngmin-webpack-plugin')
var webpackConfig = require('./webpack.config.js')
var webpackStatusConfig = require('./res/common/status/webpack.config.js')
var gettext = require('gulp-angular-gettext')
var jade = require('gulp-jade')
var clean = require('gulp-clean')
@ -64,6 +65,7 @@ gulp.task("webpack:build", function (callback) {
}),
new webpack.optimize.DedupePlugin(),
new ngminPlugin(),
// TODO: mangle when ngmin works
new webpack.optimize.UglifyJsPlugin({mangle: false})
)
myConfig.devtool = false
@ -80,6 +82,32 @@ gulp.task("webpack:build", function (callback) {
})
})
gulp.task("webpack:others", function (callback) {
var myConfig = Object.create(webpackStatusConfig)
myConfig.plugins = myConfig.plugins.concat(
new webpack.DefinePlugin({
"process.env": {
"NODE_ENV": JSON.stringify('production')
}
}),
new webpack.optimize.DedupePlugin()
// new ngminPlugin(),
// new webpack.optimize.UglifyJsPlugin({mangle: false})
)
myConfig.devtool = false
webpack(myConfig, function (err, stats) {
if (err) {
throw new gutil.PluginError('webpack:others', err)
}
gutil.log("[webpack:others]", stats.toString({
colors: true
}))
callback()
})
})
gulp.task('translate', ['jade', 'translate:extract', 'translate:compile'])
gulp.task('jade', function () {