Webpack based boilerplate for producing libraries (Input: ES6, Output: universal library)
- Webpack based.
- ES6 as a source.
- Exports in a umd format so your library works everywhere.
- ES6 test setup with Mocha and Chai.
- Linting with ESLint.
ES6 source files
|
|
webpack
|
+--- babel, eslint
|
ready to use
library
in umd format
- Setting up the name of your library
- Open
webpack.config.jsfile and change the value oflibraryNamevariable. - Open
package.jsonfile and change the value ofmainproperty so it matches the name of your library.
- Build your library
- Run
npm installto get the project's dependencies - Run
npm run buildto produce minified version of your library.
- Development mode
- Having all the dependencies installed run
npm run dev. This command will generate an non-minified version of your library and will run a watcher so you get the compilation on file change.
- Running the tests
- Run
npm run test
npm run build- produces production version of your library under thelibfoldernpm run dev- produces development version of your library and runs a watchernpm run test- well ... it runs the tests :)