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