Javascript npm module boilerplate.
- setup library name in webpack.config.js
- in package.json setup
main
property to match library name - Run
npm install
- Run
npm run build
for developmentnpm run dev
- Runing tests
npm run test
~/next.to.app $ cd ./module-bojler
~/module-bojler$ npm link
~/module-bojler$ cd ../app
~/app $ npm link module-bojler
After linking local development module with other project and you get to double react loaded instance problem. Then in the project that is using this localy linked module set webpack:
resolve: {
alias: {
react: path.resolve('./node_modules/react')
}
},
- One option is to have build files also in git
- Other option is to have lib in gitignore and commit lib it to separate branch.
- example