New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

env-inject-body-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

env-inject-body-webpack-plugin

Webpack plugin that injects a custom string into the end of the body of html-webpack-plugin output according to the environment.

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

env-inject-body-webpack-plugin

A HTML Webpack Plugin for injecting a custom string into the end of body of html-webpack-plugin output according to the environment. (inspired by inject-body-webpack-plugin)

Installation

npm i -D env-inject-body-webpack-plugin

Example

Input

webpack.config.js

import HtmlWebpackPlugin from "html-webpack-plugin"
import InjectBodyPlugin from "env-inject-body-webpack-plugin"

export default {
  mode: 'development',
  plugins: [
    new HtmlWebpackPlugin(),
    new InjectBodyPlugin({
      content: '<script src="index.js"></script>',
      env: ["development"]
    }),
  ],
}

Output

index.html

<html><body><script src="index.js"></script></body></html>

Options

TypeDefaultInfo
contentstring""The text that will be injected into the final HTML output.
envstring[][]When the value of process.env.NODE_ENV is in the list, the plugin will take effect

Keywords

html-webpack-plugin

FAQs

Package last updated on 23 Sep 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