Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
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 4,277 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.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.