diff --git a/package-lock.json b/package-lock.json index d49a6941f..fed6eccff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -70,7 +70,7 @@ "typescript": "~5.6.3", "typescript-eslint": "^8.14.0", "url-loader": "^4.1.1", - "webpack": "~5.95.0", + "webpack": "^5.96.1", "yargs": "^17.7.2" }, "engines": { @@ -1408,6 +1408,26 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/eslint": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", + "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", + "license": "MIT", + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "node_modules/@types/eslint-scope": { + "version": "3.7.7", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", + "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", + "license": "MIT", + "dependencies": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, "node_modules/@types/estree": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", @@ -2002,15 +2022,6 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-import-attributes": { - "version": "1.9.5", - "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", - "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", - "license": "MIT", - "peerDependencies": { - "acorn": "^8" - } - }, "node_modules/acorn-jsx": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", @@ -7836,18 +7847,18 @@ } }, "node_modules/webpack": { - "version": "5.95.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.95.0.tgz", - "integrity": "sha512-2t3XstrKULz41MNMBF+cJ97TyHdyQ8HCt//pqErqDvNjU9YQBnZxIHa11VXsi7F3mb5/aO2tuDxdeTPdU7xu9Q==", + "version": "5.96.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.96.1.tgz", + "integrity": "sha512-l2LlBSvVZGhL4ZrPwyr8+37AunkcYj5qh8o6u2/2rzoPc8gxFJkLj1WxNgooi9pnoc06jh0BjuXnamM4qlujZA==", "license": "MIT", "dependencies": { - "@types/estree": "^1.0.5", + "@types/eslint-scope": "^3.7.7", + "@types/estree": "^1.0.6", "@webassemblyjs/ast": "^1.12.1", "@webassemblyjs/wasm-edit": "^1.12.1", "@webassemblyjs/wasm-parser": "^1.12.1", - "acorn": "^8.7.1", - "acorn-import-attributes": "^1.9.5", - "browserslist": "^4.21.10", + "acorn": "^8.14.0", + "browserslist": "^4.24.0", "chrome-trace-event": "^1.0.2", "enhanced-resolve": "^5.17.1", "es-module-lexer": "^1.2.1", diff --git a/package.json b/package.json index 29c70b5f0..1ed9ffc60 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "typescript": "~5.6.3", "typescript-eslint": "^8.14.0", "url-loader": "^4.1.1", - "webpack": "~5.95.0", + "webpack": "^5.96.1", "yargs": "^17.7.2" }, "engines": { diff --git a/packages/webpack-plugin/src/plugin-utils.ts b/packages/webpack-plugin/src/plugin-utils.ts index af0a4b4f0..1128d12d5 100644 --- a/packages/webpack-plugin/src/plugin-utils.ts +++ b/packages/webpack-plugin/src/plugin-utils.ts @@ -132,7 +132,13 @@ export function replaceMappedCSSAssetPlaceholders({ throw new Error('Missing asset module build info for ' + resourcePath); } - if (assetModule.buildInfo.dataUrl) { + if (assetModuleSource && assetModule.buildInfo.dataUrl) { + if ('generateDataUri' in assetModule.generator!) { + const assetGenerator = assetModule.generator as { + generateDataUri(m: NormalModule): string; + }; + return assetGenerator.generateDataUri(assetModule); + } // Investigate using the data map from getData currently there is an unknown in term from escaping keeping extractDataUrlFromAssetModuleSource return extractDataUrlFromAssetModuleSource( assetModuleSource.source().toString(),