You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am attempting to consume a NPM module that has been built with babel into two build directories - one for es modules and the other for commonjs modules. The package.json 'main' property for the module points to the commonjs version, and it also has an additional 'module' property that points to the es module version.
I am attempting to consume a NPM module that has been built with babel into two build directories - one for es modules and the other for commonjs modules. The package.json 'main' property for the module points to the commonjs version, and it also has an additional 'module' property that points to the es module version.
When I import the module into my project, Intellisense automatically chooses the commonjs version of the build i.e.
In this case, the index.js file in the root of the commonjs build re-exports a number of other exports from other files like so:
For some reason Intellisense doesn't seem to work when I import like this... however if I point to the es module version it works as expected:
The only way I can make it work with the commonjs version is to import directly from the re-exported file:
Am I doing something wrong? I have tried adding a jsconfig.json file but all the settings I have tried make no difference.
The text was updated successfully, but these errors were encountered: