Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

babel-plugin-transform-jsx-to-htm does not works with webpack #83

Closed
blikblum opened this issue Apr 19, 2019 · 1 comment · Fixed by #87
Closed

babel-plugin-transform-jsx-to-htm does not works with webpack #83

blikblum opened this issue Apr 19, 2019 · 1 comment · Fixed by #87

Comments

@blikblum
Copy link
Contributor

When using babel-plugin-transform-jsx-to-htm in a webpack project, it returns an invalid plugin: the inherits option gets a module object ({default: jsx(), _esModule: true}) instead of jsx()

This occurs because webpack loads the *.mjs file (pointed by package module field) and imports @babel/plugin-syntax-jsx as a module object instead of importing the default export.

As a workaround add resolve: { mainFields: ['main'] } to webpack configuration

@jviide
Copy link
Collaborator

jviide commented Jul 29, 2019

@blikblum Thanks for the fix, it has now been released as a part of HTM 2.2 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants