-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
ancestor of #16
WebPack uses the concept of targets and provides module resolution rules (https://webpack.js.org/concepts/module-resolution/)
Module resolution depends on target, but always checks fields in package.json
:
- target
web
: fieldsbrowser
,module
,main
- target
node
: fieldsmodule
,main
So, when the package is used as
- pure Node package -
main
will be used - by WebPack -
browser
ormodule
will be used (depending on target) - by browser -
browser
version will be used
BTW: for published on NPM version we will get the public CDN: https://unpkg.com/
What to do in this issue:
Create a project, and use route4me-node
as a dependency.
Then pack this project with webpack, and look at the result. The result MUST LOOKS BRILLIANT!!! Ho ho ho