X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fconfig%2Fwebpack.common.js;fp=client%2Fconfig%2Fwebpack.common.js;h=7392c58d395ae026cef5ab756707621688c46517;hb=04de542abd940f9d2ca213fba3c68580c6c9b78a;hp=489803f2259963fe00d85c2b3da2c99dacae37ed;hpb=a8b5de6c670eb19ffbe40726bb60ef1d1dbc10dd;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/config/webpack.common.js b/client/config/webpack.common.js index 489803f22..7392c58d3 100644 --- a/client/config/webpack.common.js +++ b/client/config/webpack.common.js @@ -16,13 +16,14 @@ const ngcWebpack = require('ngc-webpack') const WebpackNotifierPlugin = require('webpack-notifier') -/* - * Webpack Constants - */ +const HMR = helpers.hasProcessFlag('hot') +const AOT = process.env.BUILD_AOT || helpers.hasNpmFlag('aot') const METADATA = { title: 'PeerTube', baseUrl: '/', - isDevServer: helpers.isWebpackDevServer() + isDevServer: helpers.isWebpackDevServer(), + HMR: HMR, + AOT: AOT } /* @@ -91,13 +92,6 @@ module.exports = function (options) { { test: /\.ts$/, use: [ - { - loader: '@angularclass/hmr-loader', - options: { - pretty: !isProd, - prod: isProd - } - }, { loader: 'ng-router-loader', options: { @@ -242,7 +236,7 @@ module.exports = function (options) { /** * The (\\|\/) piece accounts for path separators in *nix and Windows */ - /angular(\\|\/)core(\\|\/)@angular/, + /(.+)?angular(\\|\/)core(.+)?/, helpers.root('src'), // location of your src { /** @@ -276,7 +270,10 @@ module.exports = function (options) { new HtmlWebpackPlugin({ template: 'src/index.html', title: METADATA.title, - chunksSortMode: 'dependency', + chunksSortMode: function (a, b) { + const entryPoints = [ 'inline', 'polyfills', 'sw-register', 'styles', 'vendor', 'main' ] + return entryPoints.indexOf(a.names[0]) - entryPoints.indexOf(b.names[0]) + }, metadata: METADATA, inject: 'body' }),