web-padawan/polymer3-webpack-starter

[Question]How do node_module components like @polymer get resolved by webpack

ivegotwings opened this issue · 2 comments

Hi,

I browsed through the code and I could not find how any node_module component like '@polymer/' will get resolved by webpack as in how will the dependency be resolved. Polymer serve has a built in way for this. Not sure what has been used here. Typically we need to provide an alias using resolve.alias.

Thanks

Hi, AFAIK webpack uses node resolution. No alias configuration is needed for this config.

Here you can find the relevant docs: https://webpack.js.org/concepts/modules/

All the components like @polymer are npm packages, they are just "scoped". It is quite common, e.g. Babel starting from version 7 also uses @babel scope. So, this is not Polymer specific. It is Node and npm-specific thing, any tools like webpack and Rollup should work with these modules.

Closing as this is not an issue but feel free to ask more questions if there is something unclear.