1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Add webpack config for analyzing builds and improve ts speed

This commit is contained in:
Bill Thornton 2023-09-12 12:54:50 -04:00
parent 46f9a0fc8a
commit 5cb181f68c
4 changed files with 937 additions and 14 deletions

View file

@ -1,6 +1,7 @@
const path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const { DefinePlugin } = require('webpack');
@ -100,6 +101,11 @@ const config = {
to: path.resolve(__dirname, './dist')
};
})
}),
new ForkTsCheckerWebpackPlugin({
typescript: {
configFile: path.resolve(__dirname, 'tsconfig.json')
}
})
],
output: {
@ -110,6 +116,8 @@ const config = {
},
optimization: {
runtimeChunk: 'single',
removeAvailableModules: false,
removeEmptyChunks: false,
splitChunks: {
chunks: 'all',
maxInitialRequests: Infinity,
@ -216,14 +224,22 @@ const config = {
exclude: /node_modules/,
use: [
'worker-loader',
'ts-loader'
{
loader: 'ts-loader',
options: {
transpileOnly: true
}
}
]
},
{
test: /\.(ts|tsx)$/,
exclude: /node_modules/,
use: [{
loader: 'ts-loader'
loader: 'ts-loader',
options: {
transpileOnly: true
}
}]
},
/* modules that Babel breaks when transforming to ESM */