Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Unable to resolve modules outside of the src/ folder #24

Open
matthewp opened this issue Mar 12, 2019 · 3 comments
Open

Unable to resolve modules outside of the src/ folder #24

matthewp opened this issue Mar 12, 2019 · 3 comments

Comments

@matthewp
Copy link

This is in plugin-build-web. I believe the cause of the problem is that files are copied into a dist-src/ folder before rollup is run. This means attempts to access modules outside of src/ will break the build.

My use case is that I use relative paths to import modules inside of node_modules/ because that's the only way it works in the browser. I think this could be fixed if pika created a symlink in pkg/ to the parent node_modules/ folder.

@FredKSchott
Copy link
Owner

This thread in Spectrum may be relevant to what you're trying to do: https://spectrum.chat/pika/pika-pack/simple-web-component-with-pika-pack~e2a027f4-87f7-4c6e-8f1c-8f521a015bae

/cc @krumware

@matthewp
Copy link
Author

Thanks for the link. Sounds like using non web compatible bare specifier names is a requirement at this time, is that right?

Maybe this should be made to work for web_modules though (hadn't tried this yet).

@FredKSchott
Copy link
Owner

FredKSchott commented Mar 12, 2019

Yea, for better or worse it is. I say better only because that's what's needed to publish to npm (I know that's still a someone controversial statement in the Polymer community, but it's objectively true that npm does not enforce a deterministic/standard location of your package any its dependencies).

Instead of fighting that, @pika/pack looks to work with the system as it exists today (and how most users expect it to work today) while letting @pika/web solve the web-compatiblity issue at install time.

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

No branches or pull requests

2 participants