@grampro/svelte-mf-remote

0.0.2 • Public • Published

@grampro/svelte-mf-remote

A reusable Webpack configuration package to simplify your project setup. This package allows you to easily configure Webpack with dynamic settings for publicPath, ModuleFederationPlugin properties, and more.

Installation

Install the package via npm:

npm install @grampro/svelte-mf-remote

Usage

In your project's webpack.config.js, import and use the configuration function provided by this package. You can pass dynamic values to customize the configuration for your specific needs.

Example Configuration

const generateWebpackConfig = require("@grampro/smfr");

module.exports = generateWebpackConfig({
  mode: process.env.NODE_ENV,
  publicPath: "http://localhost:8080/",
  port: 8080,
  federationConfig: {
    name: "header",
    filename: "remoteEntry.js",
    exposes: {
      "./Dash": "./src/Dash.svelte",
      "./Header": "./src/Header.svelte",
    },
  },
});

Parameters

The generateWebpackConfig function accepts an object with the following properties:

  • mode: The mode in which to run Webpack (development or production). Defaults to "development".
  • publicPath: The public URL of the output directory when referenced in a browser. Defaults to "http://localhost:8080/".
  • federationConfig: An object to configure the ModuleFederationPlugin. It contains:
  • name: The name of the container.
  • filename: The filename of the container entry.
  • remotes: An object specifying the remotes for the container.
  • exposes: An object specifying the modules to expose from this container.
  • port: Port for remote

Package Sidebar

Install

npm i @grampro/svelte-mf-remote

Weekly Downloads

0

Version

0.0.2

License

ISC

Unpacked Size

4.3 kB

Total Files

3

Last publish

Collaborators

  • josephvanto
  • anandhu_or