Open
Description
Description
Webpack fails when using assets file in packages.
E.g.:
packageA
a.js
a.jpg
a.css
a.ttf
// a.css
@font-face {
// ...
src: url("./a.ttf") // expecting the ttf can be handled
}
// a.js
import a from './a.jpg' // expecting image path
The above all working at Vite, but fails in Webpack.
Example logs:
{
moduleIdentifier: '/home/runner/work/Mister-Hope.github.io/Mister-Hope.github.io/node_modules/.pnpm/[email protected][email protected]/node_modules/esbuild-loader/dist/index.cjs??clonedRuleSet-6.use[0]!/home/runner/work/Mister-Hope.github.io/Mister-Hope.github.io/node_modules/.pnpm/[email protected][email protected]/node_modules/mini-css-extract-plugin/dist/loader.js!/home/runner/work/Mister-Hope.github.io/Mister-Hope.github.io/node_modules/.pnpm/[email protected][email protected]/node_modules/css-loader/dist/cjs.js??clonedRuleSet-9.use[1]!/home/runner/work/Mister-Hope.github.io/Mister-Hope.github.io/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-9.use[2]!/home/runner/work/Mister-Hope.github.io/Mister-Hope.github.io/node_modules/.pnpm/[email protected][email protected][email protected][email protected]_re_73rm6fxvjsbxj5n6juzbrykydq/node_modules/vuepress-plugin-md-enhance/lib/client/styles/revealjs/theme/fonts/league-gothic/league-gothic.css',
moduleName: './node_modules/.pnpm/[email protected][email protected][email protected][email protected]_re_73rm6fxvjsbxj5n6juzbrykydq/node_modules/vuepress-plugin-md-enhance/lib/client/styles/revealjs/theme/fonts/league-gothic/league-gothic.css',
message: 'Module build failed (from ./node_modules/.pnpm/[email protected][email protected]/node_modules/mini-css-extract-plugin/dist/loader.js):\n' +
'HookWebpackError: Module build failed (from ./node_modules/.pnpm/[email protected][email protected]/node_modules/esbuild-loader/dist/index.cjs):\n' +
'Error: Transform failed with 1 error:\n' +
'/home/runner/work/Mister-Hope.github.io/Mister-Hope.github.io/node_modules/.pnpm/[email protected][email protected][email protected][email protected]_re_73rm6fxvjsbxj5n6juzbrykydq/node_modules/vuepress-plugin-md-enhance/lib/client/styles/revealjs/theme/fonts/league-gothic/league-gothic.eot:2:338: ERROR: Expected ";" but found "�"\n' +
Reproduction
https://github.com/Mister-Hope/Mister-Hope.github.io/actions/runs/7017110732/job/19089734000
Used Package Manager
pnpm
System Info
.