diff --git a/.escheckrc b/.escheckrc index 195d28b9fc..37003a295a 100644 --- a/.escheckrc +++ b/.escheckrc @@ -5,7 +5,6 @@ "not": [ "./dist/libraries/pdf.worker.js", "./dist/libraries/worker-bundle.js", - "./dist/libraries/wasm-gen/libarchive.js", "./dist/serviceworker.js" ] } diff --git a/src/plugins/comicsPlayer/plugin.js b/src/plugins/comicsPlayer/plugin.js index dd0f77da60..172355e2f0 100644 --- a/src/plugins/comicsPlayer/plugin.js +++ b/src/plugins/comicsPlayer/plugin.js @@ -1,4 +1,3 @@ -// eslint-disable-next-line import/named, import/namespace import { Archive } from 'libarchive.js'; import loading from '../../components/loading/loading'; import dialogHelper from '../../components/dialogHelper/dialogHelper'; diff --git a/webpack.common.js b/webpack.common.js index 651440dac1..b58058f53f 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -4,12 +4,13 @@ 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'); +const { DefinePlugin, IgnorePlugin } = require('webpack'); const packageJson = require('./package.json'); const Assets = [ 'native-promise-only/npo.js', 'libarchive.js/dist/worker-bundle.js', + 'libarchive.js/dist/libarchive.wasm', '@jellyfin/libass-wasm/dist/js/default.woff2', '@jellyfin/libass-wasm/dist/js/subtitles-octopus-worker.js', '@jellyfin/libass-wasm/dist/js/subtitles-octopus-worker.wasm', @@ -17,11 +18,6 @@ const Assets = [ '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'; let COMMIT_SHA = ''; try { @@ -103,13 +99,11 @@ const config = { }; }) }), - new CopyPlugin({ - patterns: LibarchiveWasm.map(asset => { - return { - from: path.resolve(__dirname, `./node_modules/${asset}`), - to: path.resolve(__dirname, './dist/libraries/wasm-gen') - }; - }) + // The libarchive.js worker-bundle is copied manually. + // If it is automatically bundled, escheck will fail since it uses import.meta.url. + new IgnorePlugin({ + resourceRegExp: /worker-bundle\.js$/, + contextRegExp: /libarchive.js/ }), new ForkTsCheckerWebpackPlugin({ typescript: {