1.3.0 • Published 4 years ago

html-webpack-inline-runtime-plugin v1.3.0

Weekly downloads
3,104
License
MIT
Repository
github
Last release
4 years ago

html-webpack-inline-runtime-plugin

github actions npm

Automatically creates inline scripts for your runtime chunk(s) based on your runtimeChunk setting in the optimization key of webpack settings. Requires html-webpack-plugin.

See optimization.runtimeChunk in the webpack documentation for the valid configuration settings. The plugin itself needs no configuration, it should activate automatically as long as runtimeChunk isn't disabled/not set.

Usage

Here is a simplified webpack configuration that would activate this plugin. This config also uses [contenthash] in the filename and hashes module ids (neither are a requirement of the plugin) to help with long term caching which might be of interest for those that are already optimizing their runtime http requests.

const HtmlPlugin = require("html-webpack-plugin");
const HtmlRuntimePlugin = require("html-webpack-inline-runtime-plugin");

module.exports = {
  mode: "production",
  output: {
    filename: "[name].[contenthash].js"
  },
  optimization: {
    moduleIds: "hashed",
    runtimeChunk: "single" // config value that the plugin reads
  },
  plugins: [
    new HtmlPlugin(),
    new HtmlRuntimePlugin()
  ]
};
1.3.0

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago