Socket
Book a DemoInstallSign in
Socket

html-inject-version-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-inject-version-webpack-plugin

html-inject-version-webpack-plugin ========

0.0.1
latest
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

html-inject-version-webpack-plugin

Usage

Given a webpack 4 project, install it as a local development dependency:

npm install html-inject-version-webpack-plugin --save-dev

Then, simply configure it as a plugin in the webpack config:

var HtmlInjectVersionWebpackPlugin = require("html-inject-version-webpack-plugin");
module.exports = {
    plugins: [
        new HtmlInjectVersionWebpackPlugin()
    ],
};

It will outputs commitInfo and version such as:

<!doctype html>
<html lang="en">

<head>
    <meta charset="utf-8" />
</head>

<body>...</body>

</html>
<script>
    window.__VERSION__ = `1.0.0`;
    console.log('%c%s', 'color: white; background: green', `[*] version: v1.0.0`);
</script>
<!--
    "version": "*",
    "commitId": "*",
    "commitName": "*",
    "commitDate": "*",
    "message": "*",
    "buildDate": "*"
-->

Configuration

new HtmlInjectVersionWebpackPlugin({
    target: Array, // target file, default `['index.html']`
    commit: Boolean, // whether surport inject commit info into html, default `true`
    version: Boolean, // whether surport inject commit version into html, default `true`
})

FAQs

Package last updated on 05 Oct 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.