mirror of
https://github.com/openstf/stf
synced 2025-10-04 10:19:30 +02:00
Separated webpack entries from chunks so the big chunks can be cached easily.
This commit is contained in:
parent
080d7d9e39
commit
0add3eaddc
6 changed files with 61 additions and 35 deletions
|
@ -40,6 +40,9 @@ module.exports = function(options) {
|
|||
app.use('/static/build', webpack({
|
||||
debug: true
|
||||
, devtool: 'eval'
|
||||
, stats: {
|
||||
colors: true
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
require('angular')
|
||||
require('angular-route')
|
||||
require('angular-touch')
|
||||
require.ensure([], function (require) {
|
||||
|
||||
require('angular-gettext')
|
||||
require('ng-file-upload')
|
||||
require('angular-hotkeys')
|
||||
require('angular')
|
||||
require('angular-route')
|
||||
require('angular-touch')
|
||||
|
||||
angular.module('app', [
|
||||
require('angular-gettext')
|
||||
require('ng-file-upload')
|
||||
require('angular-hotkeys')
|
||||
|
||||
angular.module('app', [
|
||||
'ngRoute',
|
||||
'ngTouch',
|
||||
'gettext',
|
||||
|
@ -20,7 +22,7 @@ angular.module('app', [
|
|||
require('./help').name,
|
||||
require('./../common/lang').name,
|
||||
require('./../test/samples/vs-repeat').name
|
||||
])
|
||||
])
|
||||
.config(['$routeProvider', '$locationProvider',
|
||||
function ($routeProvider, $locationProvider) {
|
||||
$locationProvider.hashPrefix('!');
|
||||
|
@ -30,6 +32,9 @@ angular.module('app', [
|
|||
})
|
||||
}
|
||||
])
|
||||
.config(function(hotkeysProvider) {
|
||||
.config(function (hotkeysProvider) {
|
||||
hotkeysProvider.includeCheatSheet = false
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
|
|
|
@ -23,5 +23,6 @@ html
|
|||
div(ng-view).fill-height
|
||||
|
||||
script var APP = !{JSON.stringify(APP)}
|
||||
script(src='/static/build/bundle.js')
|
||||
script(src='/static/build/commons.entry.js')
|
||||
script(src='/static/build/app.entry.js')
|
||||
script(src='/static/bower_components/stf-analytics/analytics.js')
|
||||
|
|
5
res/auth-ldap/scripts/entry.js
Normal file
5
res/auth-ldap/scripts/entry.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
require.ensure([], function (require) {
|
||||
require('angular')
|
||||
require('angular-route')
|
||||
|
||||
})
|
5
res/auth-mock/scripts/entry.js
Normal file
5
res/auth-mock/scripts/entry.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
require.ensure([], function (require) {
|
||||
require('angular')
|
||||
require('angular-route')
|
||||
|
||||
})
|
|
@ -1,13 +1,19 @@
|
|||
var pathutil = require('./lib/util/pathutil')
|
||||
var webpack = require('webpack')
|
||||
var CommonsChunkPlugin = require("webpack/lib/optimize/CommonsChunkPlugin")
|
||||
|
||||
module.exports = {
|
||||
cache: true
|
||||
, entry: pathutil.resource('app/app.js')
|
||||
, entry: {
|
||||
app: pathutil.resource('app/app.js')
|
||||
, authldap: pathutil.resource('auth-ldap/scripts/entry.js')
|
||||
, authmock: pathutil.resource('auth-mock/scripts/entry.js')
|
||||
}
|
||||
, output: {
|
||||
path: pathutil.resource('build')
|
||||
, publicPath: '/static/build/'
|
||||
, filename: 'bundle.js'
|
||||
, filename: 'entry/[name].entry.js'
|
||||
, chunkFilename: '[id].[hash].chunk.js'
|
||||
}
|
||||
, stats: {
|
||||
colors: true
|
||||
|
@ -78,5 +84,6 @@ module.exports = {
|
|||
, ['main']
|
||||
)
|
||||
)
|
||||
, new CommonsChunkPlugin("entry/commons.entry.js")
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue