1.0.1 • Published 5 years ago
anlam v1.0.1
anlam
Webpack starter kit for creating libraries (Input: ES6, Output: UMD, CommonJS)
Features
- Webpack 4
- Babel 7
- ES6 as a source
- Exports in UMD and CommonJS
- ES6 test setup with Mocha and Chai
- Test coverage with nyc command-line-client for Istanbul
- Linting with ESLint
- Basic Travis configuration
Getting started
1. Setup the library's name
- Open
webpack.config.jsand change the value oflibraryNamevariable with your library's name. - Open
package.jsonand change the following properties with your library's equivalentnameversiondescriptionmainrepositoryauthorlicensebugshomepage
2. Install dependencies
- Run
npm installto install the library's dependencies.
3. Build for development
- Having all the dependencies installed run
yarn dev. This command will generate aUMDunminified bundle under thedistfolder and aCommonJSbundle under thelibfolder. It will also watch for changes in source files to recompile.
4. Build for production
- Having all the dependencies installed run
yarn build. This command will generate twoUMDbundles (unminified and minified) under thedistfolder and aCommonJSbundle under thelibfolder.
Scripts
yarn build- Produces production version of library underdistfolder for UMD bundle andlibfolder forCommonJSbundle.yarn build:umd- Produces an unminified UMD bundle under thedistfolder.yarn build:umdmin- Produces an minified UMD bundle under thedistfolder.yarn build:commonjs- Produces a CommonJS bundle under thelibfolder.yarn dev- Produces a development version of library (both UMD and CommonJS) and runs a watcher to watch for changes.yarn dev:umd- Produces an unminified UMD bundle under thedistfolder and runs a watcher to watch for changes.yarn dev:commonjs- Produces a CommonJS bundle under thelibfolder and runs a watcher to watch for changes.yarn test- Runs the tests.yarn coverage- Runs the tests and provides with test coverage information.yarn lint- Lints the source code with ESlint.yarn clean- Deletesdist,libandcoveragefolders.yarn prepare- Run both BEFORE the package is packed and published, on local npm install without any arguments, and when installing git dependencies.
License
MIT License