Gathering detailed insights and metrics for html-inline-script-webpack-plugin
Gathering detailed insights and metrics for html-inline-script-webpack-plugin
Gathering detailed insights and metrics for html-inline-script-webpack-plugin
Gathering detailed insights and metrics for html-inline-script-webpack-plugin
script-ext-html-webpack-plugin
Enhances html-webpack-plugin functionality with async and defer attributes for script elements
script-inline-escape-webpack-plugin
fix resource for the packaged content of script-ext-html-webpack-plugin
html-webpack-inline-script-plugin
Inject script into HTML template, extension plugin of html-webpack-plugin.
inline-script-webpack-plugin
a plugin of webpack to inline javascript into html with html-webpack-plugin
A webpack plugin for converting external script files to inline script block. Requires 'html-webpack-plugin' to work.
npm install html-inline-script-webpack-plugin
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (61.16%)
HTML (33.13%)
JavaScript (5.44%)
Shell (0.27%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
57 Stars
456 Commits
10 Forks
2 Watchers
10 Branches
3 Contributors
Updated on Apr 28, 2025
Latest Version
3.2.1
Package Id
html-inline-script-webpack-plugin@3.2.1
Unpacked Size
24.54 kB
Size
7.21 kB
File Count
11
NPM Version
6.14.17
Node Version
14.19.3
Published on
Aug 09, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
A webpack plugin for converting external script files <script src="app.js"></script>
to inline script block <script>...</script>
. Requires html-webpack-plugin to work.
Inspired by react-dev-utils created by Facebook.
1npm i html-inline-script-webpack-plugin -D
1npm i html-inline-script-webpack-plugin@^1 -D
By default, the plugin will convert all the external script files to inline script block, and remove the original script file from build assets.
1const HtmlWebpackPlugin = require('html-webpack-plugin'); 2const HtmlInlineScriptPlugin = require('html-inline-script-webpack-plugin'); 3 4module.exports = { 5 plugins: [new HtmlWebpackPlugin(), new HtmlInlineScriptPlugin()], 6};
Below are lists of options supported by this plugin:
Name | Description | Type |
---|---|---|
scriptMatchPattern | List of script files that should be processed and inject as inline script. This will be filtered using the output file name. | RegExp[] |
htmlMatchPattern | List of HTML template files that should be processed by this plugin. Useful when you have multiple html-webpack-plugin initialized. This will be filtered using the options?.filename provided by html-webpack-plugin . | RegExp[] |
assetPreservePattern | List of script files that should be preserved by this plugin after inserting them inline. This will be filtered using the output file name. | RegExp[] |
Here are some examples illustrating how to use these options:
runtime~
and app~
1const HtmlWebpackPlugin = require('html-webpack-plugin'); 2const HtmlInlineScriptPlugin = require('html-inline-script-webpack-plugin'); 3 4module.exports = { 5 plugins: [ 6 new HtmlWebpackPlugin(), 7 new HtmlInlineScriptPlugin({ 8 scriptMatchPattern: [/runtime~.+[.]js$/, /app~.+[.]js$/], 9 }), 10 ], 11};
index.html
1const HtmlWebpackPlugin = require('html-webpack-plugin'); 2const HtmlInlineScriptPlugin = require('html-inline-script-webpack-plugin'); 3 4module.exports = { 5 plugins: [ 6 new HtmlWebpackPlugin({ 7 filename: 'index.html', 8 template: 'static/index.webos.html', 9 }), 10 new HtmlWebpackPlugin({ 11 filename: 'page2.html', 12 template: 'page2.html', 13 }), 14 new HtmlInlineScriptPlugin({ 15 htmlMatchPattern: [/index.html$/], 16 }), 17 ], 18};
runtime~
and app~
and inject only to index.html
1const HtmlWebpackPlugin = require('html-webpack-plugin'); 2const HtmlInlineScriptPlugin = require('html-inline-script-webpack-plugin'); 3 4module.exports = { 5 plugins: [ 6 new HtmlWebpackPlugin({ 7 filename: 'index.html', 8 template: 'static/index.webos.html', 9 }), 10 new HtmlWebpackPlugin({ 11 filename: 'page2.html', 12 template: 'page2.html', 13 }), 14 new HtmlInlineScriptPlugin({ 15 scriptMatchPattern: [/runtime~.+[.]js$/, /app~.+[.]js$/], 16 htmlMatchPattern: [/index.html$/], 17 }), 18 ], 19};
main.js
from build assets1const HtmlWebpackPlugin = require('html-webpack-plugin'); 2const HtmlInlineScriptPlugin = require('html-inline-script-webpack-plugin'); 3 4module.exports = { 5 plugins: [ 6 new HtmlWebpackPlugin(), 7 new HtmlInlineScriptPlugin({ 8 assetPreservePattern: [/main.js$/], 9 }), 10 ], 11};
Thanks goes to these wonderful people:
@kmalakoff |
@SorsOps |
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
SAST tool detected but not run on all commits
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/7 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
22 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More