JSPM

ignore-webpack-plugin

0.3.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 672
  • Score
    100M100P100Q97663F
  • License MIT

Excludes dynamically imported dependencies from the output bundle.

Package Exports

  • ignore-webpack-plugin

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ignore-webpack-plugin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.