Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@originjs/vite-plugin-federation

Package Overview
Dependencies
Maintainers
4
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@originjs/vite-plugin-federation - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

CHANGELOG.md

6

package.json
{
"name": "@originjs/vite-plugin-federation",
"version": "0.0.2",
"version": "0.0.3",
"description": "A Vite plugin which support Module Federation.",

@@ -33,3 +33,4 @@ "main": "dist/index.js",

"prebuild": "rimraf dist",
"build": "rollup -c --sourcemap"
"build": "rollup -c",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --commit-path ."
},

@@ -45,4 +46,5 @@ "dependencies": {

"@types/estree": "^0.0.50",
"conventional-changelog-cli": "^2.1.1",
"rollup": "^2.56.0"
}
}

@@ -1,5 +0,67 @@

# Vite Module Federation Plugin
# vite-plugin-federation
Inspired by [webpack](https://github.com/webpack/webpack)'s module-federation feature.
A Vite plugin which support Module Federation.
Inspired by Webpack [Module Federation](https://webpack.js.org/concepts/module-federation/) feature.
A Vite plugin which support Module Federation.
## Install
Using npm:
```
npm install @originjs/vite-plugin-federation --save-dev
```
## Usage
- for a Vite project, in `vite.config.js`:
```js
import { defineConfig } from 'vite'
import federation from "@originjs/vite-plugin-federation";
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`:
```js
import federation from '@originjs/vite-plugin-federation'
export default {
input: 'src/index.js',
output: {
format: 'esm',
dir: 'dist'
},
plugins: [
federation({
filename: 'remoteEntry.js',
exposes: {
'./Button': './src/button'
},
shared: ['react']
})
]
}
```
## Examples
- [basic-host-remote](https://github.com/originjs/vite-plugin-federation/tree/main/packages/examples/basic-host-remote)
- [simple-react](https://github.com/originjs/vite-plugin-federation/tree/main/packages/examples/simple-react)
- [vue3-demo](https://github.com/originjs/vite-plugin-federation/tree/main/packages/examples/vue3-demo)

@@ -76,2 +76,16 @@ /**

type Remotes = (string | RemotesObject)[] | RemotesObject
type Shared = (string | SharedObject)[] | SharedObject
type ConfigTypeSet = ExposesConfig | RemotesConfig | SharedConfig
declare interface SharedRuntimeInfo {
id: string
dependencies: string[]
fileName: string
fileDir: string
filePath: string
}
/**

@@ -220,3 +234,3 @@ * Modules that should be exposed by this container. Property names are used as public paths.

*/
import?: string | false
import?: boolean

@@ -223,0 +237,0 @@ /**

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc