nitro
nitro copied to clipboard
Should support keepNames option for esbuild.
Forwarded from downstream issue:
|
Environment
- Operating System: `Windows_NT`
- Node Version: `v16.15.0`
- Nuxt Version: `3.0.0-rc.3`
- Package Manager: `[email protected]`
- Builder: `vite`
- User Config: `typescript`, `app`, `css`, `build`, `nitro`, `runtimeConfig`, `vite`
- Runtime Modules: `-`
- Build Modules: `-`
Reproduction
Describe the bug
I apologize for using a translator because of my poor English.
I checked that the class name was changed during the esbuild transform process during the nitro compiling.
Some libraries use class names. In my case, it was the sequelize-typescript
library.
A similar issue was mentioned in the esbuild repository. https://github.com/evanw/esbuild/issues/931
And I checked if the keepNames
option is available in the nuxt.config
file, but I couldn't find it.
Can I add an option within the esbuild
function for the rollup plugin in the node_modules/nitropack/dist/chunks/prerender.mjs
file?
// node_modules/nitropack/dist/chunks/prerender.mjs:732
return {
name: "esbuild",
async transform(code, id) {
...
const result = await transform(code, {
loader,
target: options.target,
define: options.define,
sourcemap: options.sourceMap,
sourcefile: id,
keepNames: true // *Here
});
...
},
Additional context
No response
Logs
No response