Replies: 1 comment
-
You can try https://github.com/laat/babel-plugin-transform-rename-import and rename the imports from |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Consider below code:
src/bar.jsx:
src/baz.jsx:
src/foo.jsx:
src/index.js:
.babelrc:
package.json:
And when i try to run
npm run build
I'll getdist/index.js:
The problem here is the dist tree will look like this:
So If I tried to use this library in a webapp I'd get import errors because the babel generated code is broken (you can see the generated requires are pointing out to unexistent jsx files).
One possible workaround obviously would be by having exports without using extensions in the first place or by not using
.jsx
files but.js
files instace. That said, I'd like to figure whether it's possible to have jsx files in place and still being able to transpile the code using babel without the final dist being broken code.Am I missing any babel plugin/config?
Beta Was this translation helpful? Give feedback.
All reactions