node package manager

ag-module-builder

ag-module-builder

Custom front-end javascript module build system

js-semistandard-style

This is a custom build system. Do NOT use it unless you are absolutely sure.

Installation

$ npm install ag-module-builder --save-dev

Usage

In the project root directory, there must be two files:

  • builder.json - build configuration file.

  • builder.js of the following content:

// builder.js file 
const builder = require('ad-module-builder');
builder();

In package.json:

{
  "scripts": {
    "build": "node builder.js"
  }
}

builder.json File

{
  "js": {
    "lint": ["index.js", "debug/script-src.js"]
  },
  "css": {
    "src": "./src/style.scss",
    "dest": "./lib/style.json",
    "lintGlob": "./src/**/*"
  },
  "debug": {
    "js": {
      "src": "./debug/script-src.js",
      "dest": "./debug/script.js"
    }
  }
}

Section js

Type: {Object}

This section provides for settings to process javascript production code.

js.lint

Type: {Array<String>}

An array of relative (to the project root) paths of javascript files to be linted.

Section css

Type: {Object}

This section provides for settings to process stylesheets.

css.src {String} - Relative (to the project root) path to the main SCSS file.

css.dest {String} - Relative (to the project root) path to the single output file. Given that this file is supposed to be required by modules, it is best to make this file have .json extension.

css.lintGlob {String} - Relative (to the project root) glob to SCSS files to be linted.

Section debug

Type: {Object}

This section provides for settings to compile a javascript file that might be included in <script> tag on a debug HTML page.