hwp-inline-runtime-chunk-plugin
TypeScript icon, indicating that this package has built-in type declarations

2.0.4 • Public • Published

hwp-inline-runtime-chunk-plugin

CI

This plugin automatically inline Webpack's runtime chunks. It requires html-webpack-plugin

This plugin was inspired by html-webpack-inline-runtime-plugin and does pretty much the same but differently.

There are a few differences though:

  • hwp-inline-runtime-chunk-plugin does not calculate integrity hashes (and therefore does not inject the CSP meta tag): the plugin must do one thing, and do it well.
  • hwp-inline-runtime-chunk-plugin has an option (off by default) to strip the source map from the inlined runtime chunk.
  • hwp-inline-runtime-chunk-plugin tries to handle all corner cases, and has an extensive test suite.

Installation

npm install --save-dev hwp-inline-runtime-chunk-plugin

Usage

const HtmlWebpackPlugin = require('html-webpack-plugin');
const { HwpInlineRuntimeChunkPlugin } = require('hwp-inline-runtime-chunk-plugin');

module.exports = {
  optimization: {
    runtimeChunk: 'single'
  },
  plugins: [
    new HtmlWebpackPlugin(),
    new HwpInlineRuntimeChunkPlugin({ removeSourceMap: true })
  ]
};

The plugin currently has only one configuration option:

  • removeSourceMap (Boolean, the default is false): whether to remove the link to the source map from the inlined source

Package Sidebar

Install

npm i hwp-inline-runtime-chunk-plugin

Weekly Downloads

34

Version

2.0.4

License

MIT

Unpacked Size

11.8 kB

Total Files

6

Last publish

Collaborators

  • wwa