mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2025-09-10 22:43:50 +02:00
Add webpack config for analyzing builds and improve ts speed
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user