X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fwebpack%2Fwebpack.video-embed.js;h=aa7c5e550081860396d33a61843e40a606b09752;hb=6fad8e51c47b9d07bea99b777c1f55c10f6d576d;hp=f6d532556c70b6a86b6fc557576ca65b203343f6;hpb=818c449b3c34e9f324ac744120c8774e724ab25e;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/webpack/webpack.video-embed.js b/client/webpack/webpack.video-embed.js index f6d532556..aa7c5e550 100644 --- a/client/webpack/webpack.video-embed.js +++ b/client/webpack/webpack.video-embed.js @@ -1,7 +1,6 @@ const helpers = require('./helpers') const path = require('path') -const CheckerPlugin = require('awesome-typescript-loader').CheckerPlugin const HtmlWebpackPlugin = require('html-webpack-plugin') const TerserPlugin = require('terser-webpack-plugin') const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin') @@ -27,15 +26,22 @@ module.exports = function () { modules: [ helpers.root('src'), helpers.root('node_modules') ], alias: { - 'video.js$': path.resolve('node_modules/video.js/dist/alt/video.core.novtt.js') + 'video.js$': path.resolve('node_modules/video.js/core.js'), + '@root-helpers': path.resolve('src/root-helpers'), + '@shared/models': path.resolve('../shared/models'), + '@shared/core-utils': path.resolve('../shared/core-utils') } }, 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/' }, @@ -48,13 +54,12 @@ module.exports = function () { test: /\.ts$/, use: [ { - loader: 'awesome-typescript-loader', + loader: 'ts-loader', options: { - configFileName: 'tsconfig.json' + configFile: 'tsconfig.base.json' } } - ], - exclude: [/\.(spec|e2e)\.ts$/] + ] }, { @@ -69,19 +74,15 @@ module.exports = function () { importLoaders: 1 } }, - // { - // loader: 'resolve-url-loader', - // options: { - // debug: true - // } - // }, { loader: 'sass-loader', options: { - sourceMap: true, - includePaths: [ - helpers.root('src/sass/include') - ] + sassOptions: { + sourceMap: true, + includePaths: [ + helpers.root('src/sass/include') + ] + } } } ] @@ -111,7 +112,9 @@ module.exports = function () { plugins: [ new ExtractTextPlugin({ - filename: '[name].[hash].css' + filename: process.env.ANALYZE_BUNDLE === 'true' + ? '[name].css' + : '[name].[hash].css' }), new PurifyCSSPlugin({ @@ -125,13 +128,11 @@ module.exports = function () { } }), - new CheckerPlugin(), - new HtmlWebpackPlugin({ template: 'src/standalone/videos/embed.html', filename: 'embed.html', title: 'PeerTube', - chunksSortMode: 'dependency', + chunksSortMode: 'auto', inject: 'body', chunks: ['video-embed'] }), @@ -140,7 +141,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'] }),