X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fwebpack%2Fwebpack.video-embed.js;h=e25677872e4f0842b7f43e845f964f18aae04a7a;hb=e36b30970078e437928eba5e3eec3d192302d7bc;hp=8320d01e71d5d3bd49cecced17809da12784228e;hpb=adb8809d43648ea0a64d6845bb39aa3bd0e005a6;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/webpack/webpack.video-embed.js b/client/webpack/webpack.video-embed.js index 8320d01e7..e25677872 100644 --- a/client/webpack/webpack.video-embed.js +++ b/client/webpack/webpack.video-embed.js @@ -3,7 +3,6 @@ const path = require('path') const HtmlWebpackPlugin = require('html-webpack-plugin') const TerserPlugin = require('terser-webpack-plugin') -const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin') const ProvidePlugin = require('webpack/lib/ProvidePlugin') const MiniCssExtractPlugin = require('mini-css-extract-plugin') @@ -25,6 +24,8 @@ module.exports = function () { modules: [ helpers.root('src'), 'node_modules' ], + symlinks: true, + alias: { 'video.js$': path.resolve('node_modules/video.js/core.js'), 'hls.js$': path.resolve('node_modules/hls.js/dist/hls.light.js'), @@ -67,14 +68,20 @@ module.exports = function () { { test: /\.ts$/, use: [ + getBabelLoader(), + { loader: 'ts-loader', options: { - configFile: 'tsconfig.json' + configFile: helpers.root('src/standalone/videos/tsconfig.json') } } ] }, + { + test: /\.m?js$/, + use: [ getBabelLoader() ] + }, { test: /\.(sass|scss)$/, @@ -162,20 +169,6 @@ module.exports = function () { chunksSortMode: 'auto', inject: 'body', chunks: [ 'test-embed' ] - }), - - /** - * Plugin LoaderOptionsPlugin (experimental) - * - * See: https://gist.github.com/sokra/27b24881210b56bbaff7 - */ - new LoaderOptionsPlugin({ - options: { - context: __dirname, - output: { - path: helpers.root('dist') - } - } }) ], @@ -186,6 +179,7 @@ module.exports = function () { ecma: 6, warnings: false, ie8: false, + safari10: false, mangle: true, compress: { passes: 3, @@ -212,3 +206,18 @@ module.exports = function () { return configuration } + +function getBabelLoader () { + return { + loader: 'babel-loader', + options: { + presets: [ + [ + '@babel/preset-env', { + targets: 'last 1 Chrome version, last 2 Edge major versions, Firefox ESR, Safari >= 12, ios_saf >= 12' + } + ] + ] + } + } +}