Replies: 14 comments 9 replies
-
this has also been the only hurdle for us switching to swc: decorator support similar config here in {
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": true,
"decorators": true
}
}
}
congrats on the launch, by the way! |
Beta Was this translation helpful? Give feedback.
-
Crossing fingers and waiting for this! |
Beta Was this translation helpful? Give feedback.
-
Loading |
Beta Was this translation helpful? Give feedback.
-
For decorators maybe Next could check |
Beta Was this translation helpful? Give feedback.
-
Feel like we should be able to customise SWC parsing going forward, like we can atm with Babel, rather than keeping that in Next core config |
Beta Was this translation helpful? Give feedback.
-
I'm currently using a next patch to enable decorators but waiting for a more permenanent solution. |
Beta Was this translation helpful? Give feedback.
-
I need to modify
I need to add |
Beta Was this translation helpful? Give feedback.
-
Hi, I need to use an SWC plugin (WASM) but this requires editing |
Beta Was this translation helpful? Give feedback.
-
Is it possible to enable |
Beta Was this translation helpful? Give feedback.
-
Even if |
Beta Was this translation helpful? Give feedback.
-
Fallback to Babel for now: module.exports = {
presets: [
// https://babeljs.io/docs/babel-preset-typescript
[
'@babel/preset-typescript',
{
allowDeclareFields: true,
allowNamespaces: true,
allExtensions: true,
isTSX: true,
},
],
// https://babeljs.io/docs/babel-preset-react
[
'@babel/preset-react',
{
runtime: 'automatic',
development: process.env.BABEL_ENV === 'development',
},
],
],
// https://babeljs.io/docs/babel-plugin-proposal-decorators#note-compatibility-with-babelplugin-transform-class-properties
plugins: [['@babel/plugin-proposal-decorators', { version: '2023-05' }]],
}; Full example is in idea2app/Next-Bootstrap-ts#38 . |
Beta Was this translation helpful? Give feedback.
-
Top level await support is what we're craving for |
Beta Was this translation helpful? Give feedback.
-
I might need it to fix #33914 |
Beta Was this translation helpful? Give feedback.
-
bump |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the feature you'd like to request
It would be cool if Next.js can pickup a custom
.swcrc
config file in a project root directory.For example, I have decorators in project's codebase and I have
.swcrc
fileSo I turned on decorators support and tests are running just fine for the last weeks.
But Next.js struggle to compile it.
Describe the solution you'd like
It would be cool if Next.js can pickup a custom
.swcrc
config file in a project root directory.Describe alternatives you've considered
Next.js having all those things turned on by default may be?
Beta Was this translation helpful? Give feedback.
All reactions