Closed shervinchen closed 1 year ago
Not sure how you entire project look like, can you provide a complete reproduction repo? Did you check if the babel configuration are passed down or the styled-jsx plugin is consumed?
Not sure how you entire project look like, can you provide a complete reproduction repo? Did you check if the babel configuration are passed down or the styled-jsx plugin is consumed?
My repo is here: https://github.com/shervinchen/raw-ui
you can clone it and run pnpm install & pnpm run dev
, open localhost:3000
and check the brower console error
You need to use "jsx": "preserve"
in tsconfig.json to let typescript plugin resolve the modules and then pass code down to babel plugin for transform. And also you need to add __dirname: ''
to your replace plugin to replace the __dirname
in current jsx bundle.
I'll update the document later for this
You need to use
"jsx": "preserve"
in tsconfig.json to let typescript plugin resolve the modules and then pass code down to babel plugin for transform. And also you need to add__dirname: ''
to your replace plugin to replace the__dirname
in current jsx bundle.I'll update the document later for this
Thank you very much!
My rollup and babel version:
"rollup": "^2.75.7"
"@babel/core": "^7.18.6"
My rollup config:
My .babelrc.json:
when I run
rollup --config ./rollup.config.js --watch --environment NODE_ENV:development
, browser's console reports an error:and I find that style tag is still in html, it seems that rollup don't load the babel config? Is there an error in my babel config and how should I change it?