aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/config/webpack.common.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/config/webpack.common.js')
-rw-r--r--client/config/webpack.common.js23
1 files changed, 10 insertions, 13 deletions
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')
16 16
17const WebpackNotifierPlugin = require('webpack-notifier') 17const WebpackNotifierPlugin = require('webpack-notifier')
18 18
19/* 19const HMR = helpers.hasProcessFlag('hot')
20 * Webpack Constants 20const AOT = process.env.BUILD_AOT || helpers.hasNpmFlag('aot')
21 */
22const METADATA = { 21const METADATA = {
23 title: 'PeerTube', 22 title: 'PeerTube',
24 baseUrl: '/', 23 baseUrl: '/',
25 isDevServer: helpers.isWebpackDevServer() 24 isDevServer: helpers.isWebpackDevServer(),
25 HMR: HMR,
26 AOT: AOT
26} 27}
27 28
28/* 29/*
@@ -92,13 +93,6 @@ module.exports = function (options) {
92 test: /\.ts$/, 93 test: /\.ts$/,
93 use: [ 94 use: [
94 { 95 {
95 loader: '@angularclass/hmr-loader',
96 options: {
97 pretty: !isProd,
98 prod: isProd
99 }
100 },
101 {
102 loader: 'ng-router-loader', 96 loader: 'ng-router-loader',
103 options: { 97 options: {
104 loader: 'async-import', 98 loader: 'async-import',
@@ -242,7 +236,7 @@ module.exports = function (options) {
242 /** 236 /**
243 * The (\\|\/) piece accounts for path separators in *nix and Windows 237 * The (\\|\/) piece accounts for path separators in *nix and Windows
244 */ 238 */
245 /angular(\\|\/)core(\\|\/)@angular/, 239 /(.+)?angular(\\|\/)core(.+)?/,
246 helpers.root('src'), // location of your src 240 helpers.root('src'), // location of your src
247 { 241 {
248 /** 242 /**
@@ -276,7 +270,10 @@ module.exports = function (options) {
276 new HtmlWebpackPlugin({ 270 new HtmlWebpackPlugin({
277 template: 'src/index.html', 271 template: 'src/index.html',
278 title: METADATA.title, 272 title: METADATA.title,
279 chunksSortMode: 'dependency', 273 chunksSortMode: function (a, b) {
274 const entryPoints = [ 'inline', 'polyfills', 'sw-register', 'styles', 'vendor', 'main' ]
275 return entryPoints.indexOf(a.names[0]) - entryPoints.indexOf(b.names[0])
276 },
280 metadata: METADATA, 277 metadata: METADATA,
281 inject: 'body' 278 inject: 'body'
282 }), 279 }),