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)/,
{ type: "asset/resource",
exclude: /(node_modules|bmfonts)/, generator: {
type: "asset/resource", filename: "images/[name][ext]"
generator: { }
filename: "images/[name][ext]" },
} { // Third party images are inlined
}, test: /\.(png|jpg|gif)$/,
{ include: /node_modules/,
type: "asset/inline" type: "asset/inline",
}
]
}, },
] ]
}, },