3 ms·
You can use a subfolder node_modules for using simpler paths (such as "components/something" instead of "../../components/something/index.js"). For example, if
by wildpeaks 11y ago
You can use a subfolder node_modules for using simpler paths (such as "components/something" instead of "../../components/something/index.js").
For example, if your entry point is in "/src/application.js", it can require('components/something') from folder "/src/node_modules/components/something". And that works in native Node, Browserify and Webpack, so you're not tied to a specific build tool.
Any module in /src (and subfolders) first searches for modules in "/src/node_modules", but can still also load thirdparty npm-installed modules from the root "/node_modules".