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')
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/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/'
},
- // devtool: 'source-map',
+ devtool: process.env.NODE_ENV === 'production' ? false : 'source-map',
module: {
test: /\.ts$/,
use: [
{
- loader: 'awesome-typescript-loader',
+ loader: 'ts-loader',
options: {
- configFileName: 'tsconfig.json'
+ configFile: 'tsconfig.base.json'
}
}
- ],
- exclude: [/\.(spec|e2e)\.ts$/]
+ ]
},
{
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')
+ ]
+ }
}
}
]
plugins: [
new ExtractTextPlugin({
- filename: '[name].[hash].css'
+ filename: process.env.ANALYZE_BUNDLE === 'true'
+ ? '[name].css'
+ : '[name].[hash].css'
}),
new PurifyCSSPlugin({
}
}),
- new CheckerPlugin(),
-
new HtmlWebpackPlugin({
template: 'src/standalone/videos/embed.html',
filename: 'embed.html',
title: 'PeerTube',
- chunksSortMode: 'dependency',
+ chunksSortMode: 'auto',
inject: 'body',
chunks: ['video-embed']
}),
template: '!!html-loader!src/standalone/videos/test-embed.html',
filename: 'test-embed.html',
title: 'PeerTube',
- chunksSortMode: 'dependency',
+ chunksSortMode: 'auto',
inject: 'body',
chunks: ['test-embed']
}),