Snowpack: --import scanning doesn't match implicit dependencies

Created on 3 Feb 2020  路  2Comments  路  Source: snowpackjs/snowpack

Original Discussion: https://www.pika.dev/npm/snowpack/discuss/63
/cc @dy, @FredKSchott

As reported in the original discussion, our import scanner will check imports against your list of dependencies to see if its a package name vs. a file. This is fine for most cases, but some people directly rely on collections of dependencies (material-components-web) instead of individual dependencies.

We could improve this to just check the import itself. If an import is of the form web_modules/X.js or web_modules/@X/Y.js, then we should be fairly certain that it's a package and not a file within a package. This should actually simplify things, so that we don't need to worry about knownDependencies like we currently do.

bug good first issue help wanted

All 2 comments

Ah junk. I was scared of this happening.

If an import is of the form web_modules/X.js or web_modules/@X/Y.js, then we should be fairly certain that it's a package and not a file within a package. This should actually simplify things, so that we don't need to worry about knownDependencies like we currently do.

That makes sense to me! I鈥檓 happy to let someone else take this issue if possible (happy to provide guidance). Or I can open a PR if there aren鈥檛 any takers.

Feel free to take it if you have the time, you probably know this logic better than anyone :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FredKSchott picture FredKSchott  路  5Comments

FredKSchott picture FredKSchott  路  5Comments

rvion picture rvion  路  6Comments

FredKSchott picture FredKSchott  路  6Comments

wenyanqi picture wenyanqi  路  5Comments