X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fwebpack%2Fwebpack.video-embed.js;h=70141527c18190efa8866e9c64e8ac86fb1571b2;hb=4ec25ae825f8dee44d948b38d8216f9a239ff7b3;hp=319b00e5d78dbb7bc030654b112157311bb1e519;hpb=71ab65d02f359000f9ca6a00f163d66d56a33955;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/webpack/webpack.video-embed.js b/client/webpack/webpack.video-embed.js index 319b00e5d..70141527c 100644 --- a/client/webpack/webpack.video-embed.js +++ b/client/webpack/webpack.video-embed.js @@ -1,12 +1,10 @@ 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') -const ExtractTextPlugin = require('extract-text-webpack-plugin') -const PurifyCSSPlugin = require('purifycss-webpack') +const MiniCssExtractPlugin = require('mini-css-extract-plugin') module.exports = function () { const configuration = { @@ -28,8 +26,9 @@ module.exports = function () { alias: { 'video.js$': path.resolve('node_modules/video.js/core.js'), - '@app': path.resolve('src/app'), - '@shared': path.resolve('../shared') + '@root-helpers': path.resolve('src/root-helpers'), + '@shared/models': path.resolve('../shared/models'), + '@shared/core-utils': path.resolve('../shared/core-utils') } }, @@ -54,46 +53,39 @@ 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$/] + ] }, { test: /\.(sass|scss)$/, - use: ExtractTextPlugin.extract({ - fallback: 'style-loader', - use: [ - { - loader: 'css-loader', - options: { + use: [ + MiniCssExtractPlugin.loader, + + { + loader: 'css-loader', + options: { + sourceMap: true, + importLoaders: 1 + } + }, + + { + loader: 'sass-loader', + options: { + sassOptions: { sourceMap: true, - importLoaders: 1 - } - }, - // { - // loader: 'resolve-url-loader', - // options: { - // debug: true - // } - // }, - { - loader: 'sass-loader', - options: { - sassOptions: { - sourceMap: true, - includePaths: [ - helpers.root('src/sass/include') - ] - } + includePaths: [ + helpers.root('src/sass/include') + ] } } - ] - }) + } + ] }, { @@ -118,25 +110,12 @@ module.exports = function () { }, plugins: [ - new ExtractTextPlugin({ + new MiniCssExtractPlugin({ filename: process.env.ANALYZE_BUNDLE === 'true' ? '[name].css' : '[name].[hash].css' }), - new PurifyCSSPlugin({ - paths: [ - helpers.root('src/standalone/videos/embed.ts'), - helpers.root('src/standalone/videos/test-embed.html') - ], - purifyOptions: { - minify: true, - whitelist: [ '*vjs*', '*video-js*' ] - } - }), - - new CheckerPlugin(), - new HtmlWebpackPlugin({ template: 'src/standalone/videos/embed.html', filename: 'embed.html',