
Product
Socket Now Available on Google Cloud Marketplace
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.
webpack-inline-manifest-plugin
Advanced tools
inline your Webpack manifest.js with a script tag to save http request
This is a webpack plugin that inline your manifest.js with a script tag to save http request. Cause webpack's runtime always change between every build, it's better to split the runtime code out for long-term caching.
Install the plugin with npm:
$ npm i webpack-inline-manifest-plugin -D
This plugin need to work with HtmlWebpackPlugin v2.10.0 and above:
Step1: split out the runtime code
// for explicit vendor chunk config
[
new webpack.optimize.CommonsChunkPlugin({
names: ['vendor', 'manifest']
})
]
// or specify which chunk to split manually
[
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
chunks: ['...']
})
]
Step2: config HtmlWebpackPlugin:
[
new HtmlWebpackPlugin({
template: './index.ejs'
})
]
Step3: config WebpackInlineManifestPlugin
webpackManifest
, result in htmlWebpackPlugin.files[name]
, you can specify any other name except manifest
, beacuse the name manifest
haved been used by HtmlWebpackPlugin for H5 app cache manifest.Call:
const WebpackInlineManifestPlugin = require('webpack-inline-manifest-plugin');
Config:
[
new WebpackInlineManifestPlugin({
name: 'webpackManifest'
})
]
Finally in HTML:
<!-- index.ejs -->
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>App</title>
</head>
<body>
<%=htmlWebpackPlugin.files.webpackManifest%>
</body>
</html>
Done!
FAQs
inline your Webpack manifest.js with a script tag to save http request
The npm package webpack-inline-manifest-plugin receives a total of 5,139 weekly downloads. As such, webpack-inline-manifest-plugin popularity was classified as popular.
We found that webpack-inline-manifest-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.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.
Research
Security News
Research uncovers Black Basta's plans to exploit package registries for ransomware delivery alongside evidence of similar attacks already targeting open source ecosystems.