
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
html-inline-source-webpack-plugin
Advanced tools
🔧A webpack plugin to inline source in html, wrapper of inline-source.
🔧A webpack plugin to inline source in html, wrapper of inline-source.
$ npm install html-inline-source-webpack-plugin --save-dev
// webpack.config.js
let HtmlInlineSourceWebpackPlugin = require('html-inline-source-webpack-plugin');
module.exports = {
/* Your config */
plugins : [
/* ... */
new HtmlInlineSourceWebpackPlugin(),
],
};
<!DOCTYPE html>
<html>
<head>
<title> index </title>
<link inline href="css/index.css" rel="stylesheet">
</head>
<body>
<script inline src="js/index.js" charset="utf-8"></script>
</body>
</html>
<script inline src="js/index.js" charset="utf-8"></script>
inline
attribute to inline source;src
or href
is linked to a correct file.new HtmlInlineSourceWebpackPlugin()
This option would apply to all files.
new HtmlInlineSourceWebpackPlugin({
option : {
compress : false,
rootpath : path.resolve('./dist'),
},
})
Use test
to let different option apply to different files.
new HtmlInlineSourceWebpackPlugin([
{
test : /\bindex\.html$/,
option : {
ignore : 'script',
rootpath : path.resolve('./dist'),
},
},
{
test : /\bexample\.html$/,
option : {
ignore : 'css',
rootpath : path.resolve('./dist'),
},
},
{
/* This option would apply to the rest files */
option : {
ignore : ['script', 'css'],
rootpath : path.resolve('./dist'),
},
},
])
see here.
new HtmlInlineSourceWebpackPlugin(function () {
console.log('inline source done!');
})
/* or */
new HtmlInlineSourceWebpackPlugin({
/* option */
}, function () {
console.log('inline source done!');
})
html-webpack-plugin
, only inline source in head
or body
.src
directory.src
directory.MIT
1.1.0 - Add Callback
FAQs
🔧A webpack plugin to inline source in html, wrapper of inline-source.
The npm package html-inline-source-webpack-plugin receives a total of 18 weekly downloads. As such, html-inline-source-webpack-plugin popularity was classified as not popular.
We found that html-inline-source-webpack-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.