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')
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'),
{
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)$/,
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')
- }
- }
})
],
ecma: 6,
warnings: false,
ie8: false,
+ safari10: false,
mangle: true,
compress: {
passes: 3,
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'
+ }
+ ]
+ ]
+ }
+ }
+}