kriasoft / bundle-webpack-plugin

Webpack plugin for emitting additional application bundles for Node.js, SSR, Cloudflare Workers, etc.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bundle Webpack Plugin · npm package npm package Discord

This Webpack plugin creates an additional application bundle for the selected execution environment (Webpack target). This is often used for scenarios such as server-side rendering / pre-rendering (SSR).

Usage Example

webpack.config.js

const { BundleWebpackPlugin } = require("bundle-webpack-plugin");

module.exports = {
  // The core application bundle for browsers.
  name: "app",
  entry: "./src/index",
  target: "browserslist:defaults",

  plugins: [
    new BundleWebpackPlugin({
      // Additional (reverse proxy) bundle for Cloudflare Workers.
      name: "proxy",
      entry: "./src/proxy",
      target: "browserslist:last 2 Chrome versions",
    }),
  ],
};

Related Projects

  • Node.js API Starter - Monorepo project template based on Yarn v2, GraphQL.js, React, and Relay.

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.

About

Webpack plugin for emitting additional application bundles for Node.js, SSR, Cloudflare Workers, etc.

License:MIT License


Languages

Language:JavaScript 100.0%