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

Running npx @pika/web does not produce any web_modules directory #14

Closed
ThomasG77 opened this issue Mar 4, 2019 · 2 comments
Closed

Comments

@ThomasG77
Copy link

I'm trying your tool and running npx @pika/web does not produce any web_modules directory.
The guess is the fact it's related to the way I need to call the import when it's not a module
My initial imports look like import Map from 'ol/Map.js';

You can find a repository to try out the sample I'm using at the following repository https://github.com/ThomasG77/pika-web-ol as it can be related to my code and not your tool.

@FredKSchott
Copy link
Owner

I've actually been bitten by this too, it would be good for the output to show the number of dependencies installed. Also, maybe warn if none are handled.

To get better output today, put this in your package.json:

  "@pika/web": {"webDependencies": ["ol", "rbush"]},

Then you'll get the correct warnings, that neither of these dependencies export an ES Module. From the README:

By default, @pika/web will install all package.json dependencies with an ES "module" entrypoint to the web_modules/ directory. @pika/web is able to handle any legacy Common.js/Node.js transitive dependencies in your dependency tree, however the top-level dependencies (the ones that you import directly) must have a "module" entrypoint.

@ThomasG77
Copy link
Author

Ok. Thanks @FredKSchott for your feedback. It seems I will need to wait that the libraries I want to use support module *.mjs files. At least, I'm able to understand the failure :)

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

No branches or pull requests

2 participants