beerxml
v1.0.6
Published
Making Beer Import XML
Maintainers
Readme
ES6 library starter
A boilerplate for a universal (Node, web, UMD) ES6 library.
Quick usage
- Clone this repo.
- Change all relevant entries in
package.jsonandREADME.md, so they match your new shiny library. - Run
npm installto install dev dependencies. - Write your ES6 code in
srcfolder. - Write your ES6 tests in
testfolder. - Run
npm run buildto build for node. This will compile to ES5, minify, and output the result tolibfolder. - Run
npm run build-webto build and pack the files for the web. This will output the result todistfolder. - Run
npm publishto pulish to the world.
(Or, if you don't need Webpack bundling, you can use the even lighter ES6 starter).
Detailed overview
Installation
After cloning this repository, make sure to change all the relevant entries in package.json so they match your library.
npm installBuild for npm
npm run buildThis will:
- Run Webpack starting from the entry point file (
src/library.js, can be configured) - Convert all files in
srcfolder from ES6 to ES5 - According to the
bundle-nodeflag inpackage.json, it will either: - Leave them as separate files, or -
- Minify and bundle them using Webpack, without their
node_modulesdependencies - Output the result to the
libfolder
Build for web
npm run build-webThis will:
- Run Webpack starting from the entry point file (
src/library.js, can be configured) - Convert all files from ES6 to ES5
- Minify them, including all of their module dependencies, as a UMD module (so the file will be self-contained)
- Output the file to the
distfolder
Test
npm run testConfiguration
In package.json, change all the relevant entries so they match your library.
Under the section library, you can configure:
- Library name (defaults to
"Library") - Webpack entry point (defaults to
library.js) - Dist folder for Node (defaults to
lib) - Dist folder for Web (defaults to
dist) - Choose whether to bundle for Node (defaults to
true)
License
MIT
