@gioboa/vite-module-federation
Advanced tools
Comparing version 0.1.0 to 0.2.0
import { BuildHelperParams } from '@softarc/native-federation/build.js'; | ||
export declare function federation(params: BuildHelperParams): Promise<{ | ||
name: string; | ||
options(o: unknown): Promise<void>; | ||
closeBundle(): Promise<void>; | ||
}>; | ||
export declare const federation: (params: BuildHelperParams) => Promise<any>; |
{ | ||
"name": "@gioboa/vite-module-federation", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Vite/Rollup plugin for Module Federation", | ||
@@ -38,3 +38,3 @@ "type": "module", | ||
"peerDependencies": { | ||
"@softarc/native-federation": "^0.9.2-beta.7" | ||
"@softarc/native-federation": "^1.0.0-beta.2" | ||
}, | ||
@@ -44,4 +44,6 @@ "devDependencies": { | ||
"microbundle": "^0.15.1", | ||
"pretty-quick": "^3.1.3" | ||
"mime-types": "^2.1.35", | ||
"pretty-quick": "^3.1.3", | ||
"vite": "^3.1.3" | ||
} | ||
} |
@@ -31,3 +31,3 @@ # Vite/Rollup plugin for Module Federation | ||
import { federation } from '@gioboa/vite-module-federation'; | ||
import { esBuildAdapter } from './module-federation/esbuild-adapter'; | ||
import { createEsBuildAdapter } from '@softarc/native-federation-esbuild'; | ||
@@ -45,3 +45,5 @@ // https://vitejs.dev/config/ | ||
}, | ||
adapter: esBuildAdapter, | ||
adapter: createEsBuildAdapter({ | ||
plugins: [], | ||
}), | ||
}), | ||
@@ -55,3 +57,3 @@ [...] | ||
### Second step | ||
### Define configs | ||
@@ -65,31 +67,4 @@ You need to define two different configurations in the `federationConfig` property.<br> | ||
### Last step | ||
As this plugin is tooling-agnostic, you need a simple adapter for your bundler, it's just a matter of one function. | ||
Here an example: | ||
```typescript | ||
import type { BuildAdapter } from '@softarc/native-federation/build'; | ||
import * as esbuild from 'esbuild'; | ||
export const esBuildAdapter: BuildAdapter = async (options) => { | ||
const { entryPoint, external, outfile } = options; | ||
await esbuild.build({ | ||
entryPoints: [entryPoint], | ||
external, | ||
outfile, | ||
bundle: true, | ||
sourcemap: false, | ||
minify: true, | ||
format: 'esm', | ||
target: ['esnext'], | ||
}); | ||
}; | ||
``` | ||
<br> | ||
### So far so good 🎉 | ||
Now you are ready to use Module Federation in Vite! |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
567053
9
2200
5
67
1