🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@dilesoft/vite-plugin-federation-dynamic

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dilesoft/vite-plugin-federation-dynamic

A Vite plugin which support Module Federation.

1.1.9
latest
Source
npm
Version published
Weekly downloads
67
1.52%
Maintainers
1
Weekly downloads
 
Created
Source

vite-plugin-federation

A Vite plugin which support Module Federation. Inspired by Webpack Module Federation feature.

Install

Using npm:

npm install @dilesoft/vite-plugin-federation-dynamic --save-dev

Usage

  • for a Vite project, in vite.config.js:
import { defineConfig } from 'vite'
import federation from "@dilesoft/vite-plugin-federation-dynamic";

export default defineConfig({
  plugins: [
    federation({
      name: 'module-name',
      filename: 'remoteEntry.js',
      exposes: {
        './Button': './src/Button.vue',
      },
      remotes:{
          foo: 'remote_foo'
      },
      shared: ['vue']
    })
  ],
})

  • for a Rollup project, in rollup.config.js:
import federation from '@dilesoft/vite-plugin-federation-dynamic'

export default {
  input: 'src/index.js',
  output: {
    format: 'esm',
    dir: 'dist'
  },
  plugins: [
    federation({
      filename: 'remoteEntry.js',
      exposes: {
        './Button': './src/button'
      },
      shared: ['react']
    })
  ]
}

Examples

Keywords

vite

FAQs

Package last updated on 27 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts