Build
This project represents a base build pipeline for JavaScript based projects. Everything that is common among any JavaScript project, be it a node or browser (client) based is found here.
Using it
The project is published as an NPM package and can be used by adding a dev reference to it:
$ npm install @dolittle/build --save-dev
or with Yarn:
$ yarn add -D @dolittle/build
Dependencies
This project has all its dependencies as regular dependencies, which is why it is important to add a reference to this package as a developer dependency. The reason for this is to be able to get all the packages down that the build pipeline need onto your developer box.
Transpilation using Babel
This package assumes the use of Babel with presets and plugins added. We're paying attention to what gets through the different stages and gets stabilized before we add plugins for them. As a general rule of thumb, we tend to not include proposals that has not reached stage 3 from the standards committee. Babel has an overview of what is currently in stage 3.
Gulp
Included in the package is a Gulp based build pipeline. The purpose of the build is to enable an easy way to build and output what is needed for a deployable package that is widely supported in any JavaScript and module environment. It outputs by default the following module formats:
- AMD
- CommonJS
- ESModule
- SystemJS
- UMD
To take advantage of it, you'll need to install Gulp globally on your machine:
$ npm install -g gulp
with yarn
$ yarn global add gulp
Once you've done that, you can start using the build tasks by createing a gulpfile.js
at the root of your project
and add the following:
require('@dolittle/build/dist/gulp/setup')(exports);
Scripts in package.json
Eslint
Package.json 2018 babel parser
JSConfig.json
Yarn
Yalc
Recommended setup with workspaces
Tests
Karma
Wallaby
If you want to be using Wallaby, there is a pre-defined setup for it that will work with the Babel configuration for the project.
Modules
Mocking
Sinon
Assertions
Chai Sinon Chai Sinon Chai in Order