Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

webpack-inject-entry-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

webpack-inject-entry-plugin

A webpack plugin to inject code into the bundle.

latest
Source
npmnpm
Version
0.0.4
Version published
Weekly downloads
474
-35.77%
Maintainers
1
Weekly downloads
 
Created
Source

Webpack Inject Entry Plugin

A webpack plugin to inject code into the bundle

What is this? 🧐

A webpack plugin to inject a filepath into a webpack entry. This can be used to build webpack plugins that inject code into the bundle.

Compatible with both Webpack 4 and 5.

Examples 🚀

Usage in a webpack plugin:

import InjectEntryPlugin from "webpack-inject-entry-plugin";

export class MyPlugin {
  constructor(options) {
    this.options = options;
  }

  apply(compiler) {
    new InjectEntryPlugin({
      entry: "main",
      filepath: "./path/to/my/entry/file.js",
    }).apply(compiler);
  }
}

Usage in webpack.config.js:

const InjectEntryPlugin = require("webpack-inject-entry-plugin").default;

module.exports = {
  plugins: [
    new InjectEntryPlugin({
      entry: "main",
      filepath: "./service-worker.js",
    }),
  ],
};

Installation & Usage 📦

  • Add this package to your project:
    • yarn add webpack-inject-entry-plugin

API Overview 🛠

NameDescriptionType
entry The name of the webpack entry. string
filepath The filepath to the source code to inject. string

Contributing 👫

PR's and issues welcomed! For more guidance check out CONTRIBUTING.md

Licensing 📃

See the project's MIT License.

Keywords

entry

FAQs

Package last updated on 31 Mar 2023

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