Inline Code tag for the HTML Webpack Plugin
This is an extension plugin for the webpack plugin html-webpack-plugin (version 3.x or 4 or higher). It allows you to embed javascript and css source inline.
Installation
You must be running webpack on node 6 or higher.
Install the plugin with npm:
$ npm install --save-dev html-webpack-inline-code-plugin
Basic Usage
Require the plugin in your webpack config:
var HtmlWebpackInlineCodePlugin = ;
Add the plugin to your webpack config as follows:
plugins:
The above configuration will actually do nothing due to the configuration defaults.
Options
The available options are:
headTags
|bodyTags
:array
tagsName
:string
, Specifies the code extensions to use to determine. One of thescript
orstyle
values;tagsCode
:string
Inserted specific code.
Example
config code
plugins: headTags: tagName: 'script' tagCode: `var startTime = +new Date();` bodyTags: tagName: 'script' tagCode: `var endTime = +new Date();`
Source html code
Example 很抱歉,如果没有启用JavaScript,此项目将无法正常运行。请启用它。 <!-- built files will be auto injected -->
Build compiled code
Example 很抱歉,如果没有启用JavaScript,此项目将无法正常运行。请启用它。 <!-- built files will be auto injected -->