It creates and registers 5 packages with cross dependencies in private npm registry
Each package contains console.warn("PACKAGE@VERSION: ...") statement to detect number of times it's loaded
Secret package exports single function which does console.log("PACKAGE@VERSION: ...")
Packages that imports secret call it's exported function to verify package version
Main does console.info("MAIN: importing PACKAGE@VERSION") before requiring next module
Dependencies between packages are build in a way that dependency tree would look as follows:
├─┬ @dependencies-test/foo@1.0.0
│ └── @dependencies-test/secret@1.0.0
├── @dependencies-test/secret@2.0.0
└─┬ @dependencies-test/test@1.0.0
└── @dependencies-test/secret@1.0.0
- SystemJS
- Webpack
- JSPM
- node
- Webpack and node resolves modules in a same way
- JSPM resolves as expected
- sinopia
- npm configuration to use local sinopia registry for @dependency-test
npm config set @dependency-test:registry http://localhost:4873/
- will remove all new modules from node_modules and all jspm_packages
node_modules/@dependency-test,jspm_packages - remove published version of each module
npm unpublish --force - publish each module
npm publish - do
npm install - create webpack bundle
webpack - do
jspm install
You probably should clear jspm cache (
jspm cc) before installing
To see the results you should open corresponding index.html file in browser
web server is not included, so use WebStorm open in browser option
- will unpublish all modules which is published to local npm
- webpack bundle could be optimised with
--optimize-dedupeflag. more information on this flag here - how npm resolves module versions npm3
- JSPM is cool, but how to deal with typings?
- include simple web server to the project
- add test specs
- rollup support
- hook on require to do
console.infoon importing automatically, makes sense only for CJS - check if you need to
jspm ccbefore install - check node dependency resolution