Ignore Webpack Plugin ·

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 = [
{
name: "app",
entry: "./src/index",
},
{
name: "proxy",
entry: "./src/proxy",
output: { filename: "proxy.js" },
target: "browserslist:last 2 Chrome versions",
plugins: [new IgnoreAsyncImportsPlugin()],
},
];
All the import(...)
expressions within the "proxy" bundle in the example above
will be replaced with Promise.resolve(...)
.
Related Projects
Copyright
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.