mirror of
https://github.com/openstf/stf
synced 2025-10-04 18:29:17 +02:00
Starting to add build targets for common status page.
This commit is contained in:
parent
a9e2268b18
commit
1c45b6eb70
7 changed files with 43 additions and 2 deletions
28
gulpfile.js
28
gulpfile.js
|
@ -5,6 +5,7 @@ var jsonlint = require('gulp-jsonlint')
|
||||||
var webpack = require('webpack')
|
var webpack = require('webpack')
|
||||||
var ngminPlugin = require('ngmin-webpack-plugin')
|
var ngminPlugin = require('ngmin-webpack-plugin')
|
||||||
var webpackConfig = require('./webpack.config.js')
|
var webpackConfig = require('./webpack.config.js')
|
||||||
|
var webpackStatusConfig = require('./res/common/status/webpack.config.js')
|
||||||
var gettext = require('gulp-angular-gettext')
|
var gettext = require('gulp-angular-gettext')
|
||||||
var jade = require('gulp-jade')
|
var jade = require('gulp-jade')
|
||||||
var clean = require('gulp-clean')
|
var clean = require('gulp-clean')
|
||||||
|
@ -64,6 +65,7 @@ gulp.task("webpack:build", function (callback) {
|
||||||
}),
|
}),
|
||||||
new webpack.optimize.DedupePlugin(),
|
new webpack.optimize.DedupePlugin(),
|
||||||
new ngminPlugin(),
|
new ngminPlugin(),
|
||||||
|
// TODO: mangle when ngmin works
|
||||||
new webpack.optimize.UglifyJsPlugin({mangle: false})
|
new webpack.optimize.UglifyJsPlugin({mangle: false})
|
||||||
)
|
)
|
||||||
myConfig.devtool = 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('translate', ['jade', 'translate:extract', 'translate:compile'])
|
||||||
|
|
||||||
gulp.task('jade', function () {
|
gulp.task('jade', function () {
|
||||||
|
|
|
@ -193,6 +193,7 @@ module.exports = function(options) {
|
||||||
list.forEach(function(device) {
|
list.forEach(function(device) {
|
||||||
datautil.normalize(device, req.user)
|
datautil.normalize(device, req.user)
|
||||||
})
|
})
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
success: true
|
success: true
|
||||||
, devices: list
|
, devices: list
|
||||||
|
|
0
res/common/status/scripts/entry.js
Normal file
0
res/common/status/scripts/entry.js
Normal file
|
@ -4,7 +4,7 @@ html
|
||||||
title STF Not Found
|
title STF Not Found
|
||||||
meta(charset='utf-8')
|
meta(charset='utf-8')
|
||||||
meta(name='viewport', content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui')
|
meta(name='viewport', content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui')
|
||||||
include partials/styles
|
include ../partials/styles
|
||||||
body(ng-cloak).forofour.bg-danger
|
body(ng-cloak).forofour.bg-danger
|
||||||
script(src='/static/bower_components/stf-analytics/analytics.js')
|
script(src='/static/bower_components/stf-analytics/analytics.js')
|
||||||
div(ng-view)
|
div(ng-view)
|
|
@ -4,7 +4,7 @@ html
|
||||||
title STF Maintenance
|
title STF Maintenance
|
||||||
meta(charset='utf-8')
|
meta(charset='utf-8')
|
||||||
meta(name='viewport', content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui')
|
meta(name='viewport', content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui')
|
||||||
include partials/styles
|
include ../partials/styles
|
||||||
body(ng-cloak).forofour.bg-danger
|
body(ng-cloak).forofour.bg-danger
|
||||||
div(ng-view)
|
div(ng-view)
|
||||||
.forofour-container
|
.forofour-container
|
12
res/common/status/webpack.config.js
Normal file
12
res/common/status/webpack.config.js
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
var pathutil = require('./../../../lib/util/pathutil')
|
||||||
|
var options = require('./../../../webpack.config.js')
|
||||||
|
var _ = require('lodash')
|
||||||
|
|
||||||
|
module.exports = _.defaults(options, {
|
||||||
|
entry: pathutil.resource('common/status/scripts/entry.js'),
|
||||||
|
output: {
|
||||||
|
path: pathutil.resource('build'),
|
||||||
|
publicPath: '/static/build/',
|
||||||
|
filename: 'bundle-status.js'
|
||||||
|
}
|
||||||
|
})
|
Loading…
Add table
Add a link
Reference in a new issue