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
html-webpack-plugin
Simplifies creation of HTML files to serve your webpack bundles
html-webpack-inline-source-plugin
Embed javascript and css source inline when using the webpack dev server or middleware
html-inline-css-webpack-plugin
☄️ A webpack plugin for convert external stylesheet to embedded stylesheet, aka document stylesheet
@ngtools/webpack
Webpack plugin that AoT compiles your Angular components and modules.
npm install html-inline-script-webpack-plugin
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
55 Stars
456 Commits
10 Forks
3 Watching
10 Branches
3 Contributors
Updated on 24 Aug 2024
TypeScript (61.16%)
HTML (33.13%)
JavaScript (5.44%)
Shell (0.27%)
Cumulative downloads
Total Downloads
Last day
22.1%
9,227
Compared to previous day
Last week
24.3%
41,898
Compared to previous week
Last month
-3.8%
208,317
Compared to previous month
Last year
70.3%
1,337,515
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};
import()
syntax). The reason is explained in this issue.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 is run on all commits
Details
Reason
0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
Found 0/7 approved changesets -- score normalized to 0
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
20 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
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