Webpack babel based boilerplate for producing libraries (Input: ES6, Output: universal library)
- Webpack 4.
- ES6 as a source.
- Exports in a [umd]
ES6 source files
|
|
(webpack + babel)
|
|
|
umd format and Module format
Result:
library
|
|__ src
| |__ index.js (es6)
|
|__ lib
| |__ library.js (es5)
|
|__ dist
|__ src
|__ index.js (es5)
-
Create your library project
npm init
-
npm install git+http://github.com/StateTree/webpack-library-boilerplate.git
- This will create src, lib,build, test, docs directory
- Creates babel and webpack config
- Updates your package.json properties
devDependencies
andscripts
- Removes itself from your node_modules project
-
Open
webpack.config.js
file and change the value oflibraryName
variable
npm run start
- webpack dev server executes demo.jsnpm run prebuild
- Removes the dist and lib foldernpm run build
- produces module version of your library under thelib
folder and UMD version in dist foldernpm run postbuild
- buildconfig inside scripts is used to execute copy operationnpm run release:bugfix
- execute npm versionpatch
update and merge tomaster branch
npm run release:feature
- execute npm versionminor
update and merge tomaster branch
npm run release:breakingchange
- execute npm versionminor
update and merge tomaster branch
- Test Framework
- Doc support
- importing .gitignore file using copy operation
- coverage report generator