项目作者: sjinks

项目描述 :
Plugin to inline WebPack runtime chunks when using html-webpack-plugin
高级语言: TypeScript
项目地址: git://github.com/sjinks/hwp-inline-runtime-chunk-plugin.git
创建时间: 2020-09-06T05:36:03Z
项目社区:https://github.com/sjinks/hwp-inline-runtime-chunk-plugin

开源协议:MIT License

下载


hwp-inline-runtime-chunk-plugin

Build and Test

This plugin automatically inlines 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

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

Usage

  1. const HtmlWebpackPlugin = require('html-webpack-plugin');
  2. const { HwpInlineRuntimeChunkPlugin } = require('hwp-inline-runtime-chunk-plugin');
  3. module.exports = {
  4. optimization: {
  5. runtimeChunk: 'single'
  6. },
  7. plugins: [
  8. new HtmlWebpackPlugin(),
  9. new HwpInlineRuntimeChunkPlugin({ removeSourceMap: true })
  10. ]
  11. };

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