0.1.2 • Published 4 years ago

build-plugin-sto-def-html v0.1.2

Weekly downloads
2
License
MIT
Repository
-
Last release
4 years ago

Build Plugin Sto Def Html

a build script plugin for replace html-webpack-plugin config

Installation

Install the plugin:

$ npm i build-plugin-sto-def-html -D
$ yarn add build-plugin-sto-def-html --dev

Usage

build.json replace template path only

{
  "plugins": [
    [
      "build-plugin-sto-def-html",
      {
        "production": "public/prod.html"
      }
    ]
  ]
}

with html-webpack-plugin config

{
  "plugins": [
    [
      "build-plugin-sto-def-html",
      {
        "production": {
          "template": "public/prod.html",
          "minify": {
            "removeComments": true,
            "collapseWhitespace": true,
            "removeRedundantAttributes": true,
            "useShortDoctype": true,
            "removeEmptyAttributes": true,
            "removeStyleLinkTypeAttributes": true,
            "minifyJS": true,
            "minifyCSS": true,
            "minifyURLs": true
          }
        }
      }
    ]
  ]
}

with multiple runtime environment config

{
  "plugins": [
    [
      "build-plugin-sto-def-html",
      {
        "development": {
          "template": "public/index.html"
        },
        "production": {
          "template": "public/prod.html",
        }
      }
    ]
  ]
}