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

Fix libarchive bundling

This commit is contained in:
Bill Thornton 2024-09-11 10:07:18 -04:00
parent a014f2775e
commit bec74d2949
3 changed files with 7 additions and 15 deletions

View file

@ -5,7 +5,6 @@
"not": [ "not": [
"./dist/libraries/pdf.worker.js", "./dist/libraries/pdf.worker.js",
"./dist/libraries/worker-bundle.js", "./dist/libraries/worker-bundle.js",
"./dist/libraries/wasm-gen/libarchive.js",
"./dist/serviceworker.js" "./dist/serviceworker.js"
] ]
} }

View file

@ -1,4 +1,3 @@
// eslint-disable-next-line import/named, import/namespace
import { Archive } from 'libarchive.js'; import { Archive } from 'libarchive.js';
import loading from '../../components/loading/loading'; import loading from '../../components/loading/loading';
import dialogHelper from '../../components/dialogHelper/dialogHelper'; import dialogHelper from '../../components/dialogHelper/dialogHelper';

View file

@ -4,12 +4,13 @@ const CopyPlugin = require('copy-webpack-plugin');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const { DefinePlugin } = require('webpack'); const { DefinePlugin, IgnorePlugin } = require('webpack');
const packageJson = require('./package.json'); const packageJson = require('./package.json');
const Assets = [ const Assets = [
'native-promise-only/npo.js', 'native-promise-only/npo.js',
'libarchive.js/dist/worker-bundle.js', 'libarchive.js/dist/worker-bundle.js',
'libarchive.js/dist/libarchive.wasm',
'@jellyfin/libass-wasm/dist/js/default.woff2', '@jellyfin/libass-wasm/dist/js/default.woff2',
'@jellyfin/libass-wasm/dist/js/subtitles-octopus-worker.js', '@jellyfin/libass-wasm/dist/js/subtitles-octopus-worker.js',
'@jellyfin/libass-wasm/dist/js/subtitles-octopus-worker.wasm', '@jellyfin/libass-wasm/dist/js/subtitles-octopus-worker.wasm',
@ -17,11 +18,6 @@ const Assets = [
'pdfjs-dist/build/pdf.worker.js' 'pdfjs-dist/build/pdf.worker.js'
]; ];
const LibarchiveWasm = [
'libarchive.js/dist/libarchive.js',
'libarchive.js/dist/libarchive.wasm'
];
const DEV_MODE = process.env.NODE_ENV !== 'production'; const DEV_MODE = process.env.NODE_ENV !== 'production';
let COMMIT_SHA = ''; let COMMIT_SHA = '';
try { try {
@ -103,13 +99,11 @@ const config = {
}; };
}) })
}), }),
new CopyPlugin({ // The libarchive.js worker-bundle is copied manually.
patterns: LibarchiveWasm.map(asset => { // If it is automatically bundled, escheck will fail since it uses import.meta.url.
return { new IgnorePlugin({
from: path.resolve(__dirname, `./node_modules/${asset}`), resourceRegExp: /worker-bundle\.js$/,
to: path.resolve(__dirname, './dist/libraries/wasm-gen') contextRegExp: /libarchive.js/
};
})
}), }),
new ForkTsCheckerWebpackPlugin({ new ForkTsCheckerWebpackPlugin({
typescript: { typescript: {