https://github.com/kriasoft/ignore-webpack-plugin
Webpack plugin that excludes dynamically imported dependencies from the output bundle, used for SSR.
https://github.com/kriasoft/ignore-webpack-plugin
bundler cloudflare-workers ssr webpack webpack-plugin
Last synced: 2 months ago
JSON representation
Webpack plugin that excludes dynamically imported dependencies from the output bundle, used for SSR.
- Host: GitHub
- URL: https://github.com/kriasoft/ignore-webpack-plugin
- Owner: kriasoft
- License: mit
- Created: 2021-02-17T10:18:27.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-05-09T13:00:14.000Z (about 5 years ago)
- Last Synced: 2025-09-21T12:42:58.508Z (10 months ago)
- Topics: bundler, cloudflare-workers, ssr, webpack, webpack-plugin
- Language: JavaScript
- Homepage:
- Size: 1.19 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Ignore Webpack Plugin · [![npm package][npm-v]][npm] [![npm package][npm-dm]][npm] [![Discord][discord-badge]][discord]
This [Webpack](https://webpack.js.org/) 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`
```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(...)`.
## Related Projects
- [GraphQL API and Relay Starter Kit](https://github.com/kriasoft/graphql-starter) - Monorepo template pre-configured with GraphQL API, React, and Relay.
- [Node.js API Starter Kit](https://github.com/kriasoft/node-starter-kit) - Project template pre-configured with PostgreSQL, OAuth, emails, and unit tests.
## Copyright
Copyright © 2021-present Kriasoft. This source code is licensed under the MIT license found in the
[LICENSE](https://github.com/kriasoft/ignore-webpack-plugin/blob/main/LICENSE) file.
---
Made with ♥ by Konstantin Tarkus ([@koistya](https://twitter.com/koistya), [blog](https://medium.com/@koistya))
and [contributors](https://github.com/kriasoft/ignore-webpack-plugin/graphs/contributors).
[npm]: https://www.npmjs.org/package/ignore-webpack-plugin
[npm-v]: https://img.shields.io/npm/v/ignore-webpack-plugin?style=flat-square
[npm-dm]: https://img.shields.io/npm/dm/ignore-webpack-plugin?style=flat-square
[discord]: https://discord.gg/bSsv7XM
[discord-badge]: https://img.shields.io/static/v1?logo=discord&label=&message=Join+us+on+Discord!&color=033&style=flat-square