You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

ignore-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ignore-webpack-plugin

Excludes dynamically imported dependencies from the output bundle.

0.3.0
latest
Source
npmnpm
Version published
Weekly downloads
1.3K
-50.56%
Maintainers
1
Weekly downloads
 
Created
Source

Ignore Webpack Plugin · npm package npm package Discord

This Webpack plugin excludes dynamically imported dependencies from the output bundle. This is often used for scenarios such as server-side rendering / pre-rendering (SSR).

Usage Example

webpack.config.js

const { IgnoreAsyncImportsPlugin } = require("ignore-webpack-plugin");

module.exports = [
  // The core application bundle for browsers.
  {
    name: "app",
    entry: "./src/index",
    /* ... other settings ... */
  },
  // Additional (reverse proxy) bundle for Cloudflare Workers.
  {
    name: "proxy",
    entry: "./src/proxy",
    output: { filename: "proxy.js" },
    target: "browserslist:last 2 Chrome versions",
    /* ... other settings ... */
    plugins: [new IgnoreAsyncImportsPlugin()],
  },
];

All the import(...) expressions within the "proxy" bundle in the example above will be replaced with Promise.resolve(...).

Copyright © 2021-present Kriasoft. This source code is licensed under the MIT license found in the LICENSE file.

Made with ♥  by Konstantin Tarkus (@koistya, blog) and contributors.

Keywords

webpack

FAQs

Package last updated on 09 May 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