build-plugin-sto-def-html

replace html-webpack-plugin config in cone

Usage no npm install needed!

<script type="module">
  import buildPluginStoDefHtml from 'https://cdn.skypack.dev/build-plugin-sto-def-html';
</script>

README

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",
        }
      }
    ]
  ]
}