X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fwebpack%2Fwebpack.video-embed.js;h=b6a1c4c050f918f4d8db03f57445c1e1ac821ea1;hb=4504f09f6e85f09b0489debb547a17209d7176ea;hp=12ab6a639c40a93df09af7ef79f6e06c0da2098a;hpb=ae04a0ce1298ca4db8b2d0d69df36845213e5fcb;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/webpack/webpack.video-embed.js b/client/webpack/webpack.video-embed.js index 12ab6a639..b6a1c4c05 100644 --- a/client/webpack/webpack.video-embed.js +++ b/client/webpack/webpack.video-embed.js @@ -27,19 +27,25 @@ module.exports = function () { modules: [ helpers.root('src'), helpers.root('node_modules') ], alias: { - 'video.js$': path.resolve('node_modules/video.js/dist/alt/video.core.js') + 'video.js$': path.resolve('node_modules/video.js/core.js'), + '@root-helpers': path.resolve('src/root-helpers'), + '@shared': path.resolve('../shared') } }, output: { path: helpers.root('dist/standalone/videos'), - filename: '[name].[hash].bundle.js', + + filename: process.env.ANALYZE_BUNDLE === 'true' + ? '[name].bundle.js' + : '[name].[hash].bundle.js', + sourceMapFilename: '[file].map', - chunkFilename: '[id].chunk.js', + chunkFilename: '[id].[hash].chunk.js', publicPath: '/client/standalone/videos/' }, - // devtool: 'source-map', + devtool: process.env.NODE_ENV === 'production' ? false : 'source-map', module: { @@ -78,10 +84,12 @@ module.exports = function () { { loader: 'sass-loader', options: { - sourceMap: true, - includePaths: [ - helpers.root('src/sass/include') - ] + sassOptions: { + sourceMap: true, + includePaths: [ + helpers.root('src/sass/include') + ] + } } } ] @@ -111,7 +119,9 @@ module.exports = function () { plugins: [ new ExtractTextPlugin({ - filename: '[name].[hash].css' + filename: process.env.ANALYZE_BUNDLE === 'true' + ? '[name].css' + : '[name].[hash].css' }), new PurifyCSSPlugin({ @@ -131,7 +141,7 @@ module.exports = function () { template: 'src/standalone/videos/embed.html', filename: 'embed.html', title: 'PeerTube', - chunksSortMode: 'dependency', + chunksSortMode: 'auto', inject: 'body', chunks: ['video-embed'] }), @@ -140,7 +150,7 @@ module.exports = function () { template: '!!html-loader!src/standalone/videos/test-embed.html', filename: 'test-embed.html', title: 'PeerTube', - chunksSortMode: 'dependency', + chunksSortMode: 'auto', inject: 'body', chunks: ['test-embed'] }),