The package is minimized with webpack. See the ./bin/webpack.config.js file.
This will install the npm-webpack package with the required dependencies
for you from the package.json file.
$ npm installThis will generate the ./src/cjs/* files for you
from the sources code files in ./src/ts/*.
$ npm run compile-typescript-browserThis will generate the ./src/esm/*.js files for you
from the sources code files in ./src/ts/*.
$ npm run compile-typescript-moduleThis will generate the ./dist/plotboilerplate.min.js file for you
from the sources code files in ./src/cjs/*.
$ npm run webpack-browserThis will generate the ./dist/index.esm.js file for you
from the sources code files in ./src/cjs/*.
$ npm run webpack-moduleThis will generate the ./dist/plotboilerplate.min.js file for you
from the sources code files in ./src/cjs/*.
$ npm run webpack-browserThis will generate the ./dist/plotboilerplate.min.js file for you
from the sources code files in ./src/cjs/*.
$ npm run buildThe package is compiled with npm typescript. See the tsconfig.json file.
This is not yet finished; the old vanilla-JS files will soon be dropped and replaced by generated files, compiled from Typescript.
$ npm run compile-typescriptThere is also a sandbox script, compiling and running the typescript files inside your browser. Please note that due to performance reasons it is not recommended to use this in production. Always compile your typescript files for this purpose.
It is now also possible to build demos in Typescript. You don't have to compile the whole library for this, just run this command:
./bin/run-compile-demo-ts.sh <path-to-demo-folder>Example:
./bin/run-compile-demo-ts.sh demos/46-simple-audio-control/