new URL(url, import.meta.url) pattern broken for javascript modules in production #9309
Closed
7 tasks done
Labels
p4-important
Violate documented behavior or significantly improves performance (priority)
new URL(url, import.meta.url) pattern broken for .js assets in production
The above works fine in
npm run dev
:However, it's broken in
npm run build && npm run preview
, showing class.toString()
:https://vitejs.dev/guide/assets.html#new-url-url-import-meta-url
Reproduction
https://stackblitz.com/edit/vitejs-vite-ohe6tf?file=main.js
System Info
System: OS: Linux 5.0 undefined CPU: (4) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 0 Bytes / 0 Bytes Shell: 1.0 - /bin/jsh Binaries: Node: 16.14.2 - /usr/local/bin/node Yarn: 1.22.10 - /bin/yarn npm: 7.17.0 - /bin/npm npmPackages: vite: ^3.0.1 => 3.0.2
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: