ag-module-builder

1.0.1 • Public • Published

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.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    1
  • 1.0.0
    0

Package Sidebar

Install

npm i ag-module-builder

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • agorokhov