revert: webpack.config.js changes to align with upstream master

This commit is contained in:
mansiverma897993 2026-06-24 18:23:42 +05:30
parent b65c8eaebc
commit b5d7966c37

View File

@ -88,8 +88,8 @@ module.exports = {
from: "tesseract/**/*", from: "tesseract/**/*",
to: "assets/" to: "assets/"
}, { }, {
context: "node_modules/tesseract.js/", context: "node_modules/tesseract.js/dist",
from: "dist/worker.min.js", from: "worker.min.js",
to: "assets/tesseract" to: "assets/tesseract"
}, { }, {
context: "node_modules/tesseract.js-core/", context: "node_modules/tesseract.js-core/",
@ -142,7 +142,7 @@ module.exports = {
rules: [ rules: [
{ {
test: /\.m?js$/, test: /\.m?js$/,
exclude: /node_modules[\\/](?!crypto-api|bootstrap)/, exclude: /node_modules\/(?!crypto-api|bootstrap)/,
options: { options: {
configFile: path.resolve(__dirname, "babel.config.js"), configFile: path.resolve(__dirname, "babel.config.js"),
cacheDirectory: true, cacheDirectory: true,
@ -211,20 +211,18 @@ module.exports = {
filename: "assets/fonts/[name][ext]" filename: "assets/fonts/[name][ext]"
} }
}, },
{ { // First party images are saved as files to be cached
test: /\.(png|jpg|gif)$/, test: /\.(png|jpg|gif)$/,
oneOf: [
{
exclude: /(node_modules|bmfonts)/, exclude: /(node_modules|bmfonts)/,
type: "asset/resource", type: "asset/resource",
generator: { generator: {
filename: "images/[name][ext]" filename: "images/[name][ext]"
} }
}, },
{ { // Third party images are inlined
type: "asset/inline" test: /\.(png|jpg|gif)$/,
} include: /node_modules/,
] type: "asset/inline",
}, },
] ]
}, },