unbuild
unbuild copied to clipboard
decorators
Describe the feature
ERROR: Transforming JavaScript decorators to the configured target environment ("es2020") is not supported yet
tsconfig.json:
{
"compilerOptions": {
"lib": ["ESNext", "DOM"],
"target": "ESNext",
"module": "ESNext",
"strict": true,
"exactOptionalPropertyTypes": true,
"noUncheckedIndexedAccess": true,
"esModuleInterop": true,
"moduleResolution": "node",
"noEmit": true,
"skipLibCheck": true,
"experimentalDecorators": true,
"strictPropertyInitialization": false,
"emitDecoratorMetadata": true
}
}
Additional information
- [ ] Would you be willing to help implement this feature?
same..
Hi, I don't know it's related but have you guys add tslib
to dependencies? what is your typescript
version?
but it works in 1.2.1
I also tried to build the module that used decoration and got the same error as above
The same mistake, do you want to use babel to transfer the insurance first
same mistake
Workaround:
Create a build.config.ts
with the following:
import { defineBuildConfig } from 'unbuild';
export default defineBuildConfig({
rollup: {
esbuild: {
tsconfigRaw: {
compilerOptions: {
experimentalDecorators: true,
},
},
},
},
});
or add the following section to the package.json
:
"unbuild": {
"rollup": {
"esbuild": {
"tsconfigRaw": {
"compilerOptions": {
"experimentalDecorators": true
}
}
}
}
}