mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #3879 from thornbill/moar-webpack
This commit is contained in:
commit
a60f4475d9
3 changed files with 29 additions and 5 deletions
|
@ -81,11 +81,29 @@ module.exports = {
|
|||
})
|
||||
],
|
||||
output: {
|
||||
filename: '[name].jellyfin.bundle.js',
|
||||
filename: '[name].bundle.js',
|
||||
chunkFilename: '[name].[contenthash].chunk.js',
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
publicPath: ''
|
||||
},
|
||||
optimization: {
|
||||
runtimeChunk: 'single',
|
||||
splitChunks: {
|
||||
chunks: 'all',
|
||||
maxInitialRequests: Infinity,
|
||||
cacheGroups: {
|
||||
vendor: {
|
||||
test: /[\\/]node_modules[\\/]/,
|
||||
name(module) {
|
||||
// get the name. E.g. node_modules/packageName/not/this/part.js
|
||||
// or node_modules/packageName
|
||||
const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];
|
||||
return `node_modules.${packageName}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
|
@ -98,7 +116,11 @@ module.exports = {
|
|||
test: /\.(js|jsx)$/,
|
||||
exclude: /node_modules[\\/](?!@uupaa[\\/]dynamic-import-polyfill|blurhash|date-fns|epubjs|flv.js|libarchive.js|marked|react-router|screenfull)/,
|
||||
use: [{
|
||||
loader: 'babel-loader'
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
cacheCompression: false,
|
||||
cacheDirectory: true
|
||||
}
|
||||
}]
|
||||
},
|
||||
{
|
||||
|
@ -122,6 +144,8 @@ module.exports = {
|
|||
use: [{
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
cacheCompression: false,
|
||||
cacheDirectory: true,
|
||||
plugins: [
|
||||
'@babel/transform-modules-umd'
|
||||
]
|
||||
|
|
|
@ -5,8 +5,8 @@ module.exports = merge(common, {
|
|||
// In order for live reload to work we must use "web" as the target not "browserslist"
|
||||
target: process.env.WEBPACK_SERVE ? 'web' : 'browserslist',
|
||||
mode: 'development',
|
||||
entry: './scripts/site.js',
|
||||
devtool: 'source-map',
|
||||
entry: { 'main.jellyfin': './scripts/site.js' },
|
||||
devtool: 'eval-cheap-module-source-map',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
|
|
|
@ -5,7 +5,7 @@ const WorkboxPlugin = require('workbox-webpack-plugin');
|
|||
|
||||
module.exports = merge(common, {
|
||||
mode: 'production',
|
||||
entry: './scripts/site.js',
|
||||
entry: { 'main.jellyfin': './scripts/site.js' },
|
||||
plugins: [
|
||||
new WorkboxPlugin.InjectManifest({
|
||||
swSrc: path.resolve(__dirname, 'src/serviceworker.js'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue