SolidJSS
SolidJSโ€ข3y agoโ€ข
32 replies
Joe Pea

How do we configure babel proposal decorators with Solid's vite plugin?

I've got this Stackblitz:

https://stackblitz.com/edit/solidjs-templates-wyjc1i?file=index.html,src%2Findex.tsx,vite.config.ts,package.json

No luck configuring decorators like so:

export default defineConfig({
  plugins: [
    solidPlugin({
      babel: {
        plugins: ['@babel/plugin-proposal-decorators', { version: '2023-05' }],
      },
    }),
  ],


Stackblitz terminal shows this error:

[BABEL] /home/projects/solidjs-templates-wyjc1i/src/index.tsx: The decorators plugin, when .version is '2018-09' or not specified, requires a 'decoratorsBeforeExport' option, whose value must be a boolean. (While processing: "/home/projects/solidjs-templates-wyjc1i/node_modules/.pnpm/@babel+plugin-proposal-decorators@7.23.3_@babel+core@7.22.5/node_modules/@babel/plugin-proposal-decorators/lib/index.js$inherits")


Ask me why I have tooling fatigue. ๐Ÿ™ƒ Buildless for the win.
StackBlitz
Vite + solid templates
Solidjs - Templates (forked) - StackBlitz
Was this page helpful?