Overview

A build task that can be used regardless of the CLI answer.
$ npm run XXX is a script that is initially set in package.json#scripts.

In all cases, files with underscores at the beginning are excluded from the build.

Getting started#

# Watch build
$ npm run start
# Once build for NODE_ENV=development
$ npm run build
# Once build for NODE_ENV=production
$ npm run release

These commands include the following builds.

  • Clean to output & stats directory (exc. Watch build)
  • HTML/CSS/JS (using webpack)
  • Copy for static files
  • Create a manifest.json
  • Create a Service Worker
  • YAML to JSON conversion

Use a BrowserSync#

Used local server is BrowserSync.

$ npm run server

See plugins document.

Build directory clean#

Delete the contents of the output and stats directory.

$ npm run clean

File Copy#

$ npm run b:copy

See plugins document.

Create a manifest.json#

$ npm run b:manifest

See plugins document.

YAML to JSON conversion#

$ npm run b:yaml2json

See plugins document.

HTML/CSS/JS#

$ npm run b:webpack