@module-federation/vite 1.11.0 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +4 -1
  2. package/lib/index.cjs +2113 -2109
  3. package/lib/index.d.cts +131 -0
  4. package/lib/index.d.mts +131 -0
  5. package/lib/index.mjs +2239 -0
  6. package/package.json +40 -28
  7. package/lib/index.d.ts +0 -4
  8. package/lib/index.esm.js +0 -2236
  9. package/lib/index.modern.js +0 -2288
  10. package/lib/index.umd.js +0 -2257
  11. package/lib/plugins/__tests__/pluginCheckAliasConflicts.test.d.ts +0 -1
  12. package/lib/plugins/__tests__/pluginDts.test.d.ts +0 -1
  13. package/lib/plugins/pluginAddEntry.d.ts +0 -10
  14. package/lib/plugins/pluginCheckAliasConflicts.d.ts +0 -9
  15. package/lib/plugins/pluginDevProxyModuleTopLevelAwait.d.ts +0 -2
  16. package/lib/plugins/pluginDts.d.ts +0 -3
  17. package/lib/plugins/pluginMFManifest.d.ts +0 -3
  18. package/lib/plugins/pluginModuleParseEnd.d.ts +0 -10
  19. package/lib/plugins/pluginProxyRemoteEntry.d.ts +0 -2
  20. package/lib/plugins/pluginProxyRemotes.d.ts +0 -3
  21. package/lib/plugins/pluginProxySharedModule_preBuild.d.ts +0 -7
  22. package/lib/plugins/pluginVarRemoteEntry.d.ts +0 -3
  23. package/lib/utils/PromiseStore.d.ts +0 -16
  24. package/lib/utils/VirtualModule.d.ts +0 -26
  25. package/lib/utils/__tests__/VirtualModule.test.d.ts +0 -1
  26. package/lib/utils/__tests__/cssModuleHelpers.test.d.ts +0 -1
  27. package/lib/utils/__tests__/helpers.d.ts +0 -2
  28. package/lib/utils/__tests__/normalizeModuleFederationOption.test.d.ts +0 -1
  29. package/lib/utils/__tests__/publicPath.test.d.ts +0 -1
  30. package/lib/utils/__tests__/serializeRuntimeOptions.test.d.ts +0 -1
  31. package/lib/utils/aliasToArrayPlugin.d.ts +0 -10
  32. package/lib/utils/bundleHelpers.d.ts +0 -2
  33. package/lib/utils/cssModuleHelpers.d.ts +0 -75
  34. package/lib/utils/localSharedImportMap_temp.d.ts +0 -2
  35. package/lib/utils/mapCodeToCodeWithSourcemap.d.ts +0 -4
  36. package/lib/utils/normalizeModuleFederationOptions.d.ts +0 -164
  37. package/lib/utils/normalizeOptimizeDeps.d.ts +0 -9
  38. package/lib/utils/packageNameUtils.d.ts +0 -22
  39. package/lib/utils/publicPath.d.ts +0 -9
  40. package/lib/utils/serializeRuntimeOptions.d.ts +0 -10
  41. package/lib/utils/wrapManualChunks.d.ts +0 -1
  42. package/lib/virtualModules/index.d.ts +0 -6
  43. package/lib/virtualModules/virtualExposes.d.ts +0 -2
  44. package/lib/virtualModules/virtualRemoteEntry.d.ts +0 -16
  45. package/lib/virtualModules/virtualRemotes.d.ts +0 -6
  46. package/lib/virtualModules/virtualRuntimeInitStatus.d.ts +0 -3
  47. package/lib/virtualModules/virtualShared_preBuild.d.ts +0 -17
package/package.json CHANGED
@@ -1,29 +1,42 @@
1
1
  {
2
2
  "name": "@module-federation/vite",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "description": "Vite plugin for Module Federation",
5
5
  "type": "module",
6
- "source": "src/index.ts",
7
6
  "main": "./lib/index.cjs",
8
- "types": "lib/index.d.ts",
7
+ "module": "./lib/index.mjs",
8
+ "types": "./lib/index.d.mts",
9
+ "exports": {
10
+ ".": {
11
+ "types": {
12
+ "import": "./lib/index.d.mts",
13
+ "require": "./lib/index.d.cts"
14
+ },
15
+ "import": "./lib/index.mjs",
16
+ "require": "./lib/index.cjs"
17
+ }
18
+ },
9
19
  "files": [
10
20
  "lib/**/*"
11
21
  ],
12
22
  "scripts": {
13
23
  "prepare": "husky install",
14
- "fmt": "prettier --write src",
15
- "fmt.check": "prettier --check src",
16
- "format": "pretty-quick",
17
- "dev": "microbundle watch --no-sourcemap --compress=false",
18
- "build": "rimraf lib && microbundle --no-sourcemap --compress=false",
19
- "dev-rv": "pnpm -filter 'examples-rust-vite*' run dev",
20
- "preview-rv": "pnpm -filter 'examples-rust-vite*' run preview",
21
- "dev-vv": "pnpm -filter 'examples-vite-vite*' run dev",
22
- "dev-nv": "pnpm -filter 'examples-nuxt-vite-host' -filter 'examples-vite-vite-remote' run dev",
23
- "preview-vv": "pnpm -filter 'examples-vite-vite*' run preview",
24
- "multi-example": "pnpm --filter \"multi-example-*\" --parallel run start",
25
- "test": "vitest",
26
- "e2e": "playwright test"
24
+ "fmt": "oxfmt src",
25
+ "fmt.check": "oxfmt --check src",
26
+ "dev": "tsdown --watch",
27
+ "build": "tsdown",
28
+ "clean": "pnpm -r exec rm -rf dist .__mf__temp __mf__virtual .vite node_modules/.vite",
29
+ "dev-rv": "pnpm clean && pnpm -filter 'examples-rust-vite*' run dev",
30
+ "preview-rv": "pnpm clean && pnpm -filter 'examples-rust-vite*' run preview",
31
+ "dev-vv": "pnpm clean && pnpm -filter 'examples-vite-vite*' run dev",
32
+ "dev-nv": "pnpm clean && pnpm -filter 'examples-nuxt-vite-host' -filter 'examples-vite-vite-remote' run dev",
33
+ "preview-vv": "pnpm clean && pnpm -filter 'examples-vite-vite*' --parallel run preview",
34
+ "multi-example": "pnpm clean && pnpm --filter \"multi-example-*\" --parallel run start",
35
+ "test": "vitest run src",
36
+ "test:integration": "vitest run integration",
37
+ "e2e": "playwright test",
38
+ "changeset": "changeset",
39
+ "changeset:status": "changeset status"
27
40
  },
28
41
  "repository": {
29
42
  "type": "git",
@@ -44,32 +57,31 @@
44
57
  "url": "https://github.com/module-federation/vite/issues"
45
58
  },
46
59
  "homepage": "https://github.com/module-federation/vite#readme",
47
- "packageManager": "pnpm@9.14.2",
60
+ "packageManager": "pnpm@10.28.2",
48
61
  "peerDependencies": {
49
- "vite": "<=7.1.7"
62
+ "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
50
63
  },
51
64
  "dependencies": {
52
- "@module-federation/dts-plugin": "^0.21.6",
53
- "@module-federation/runtime": "^0.21.6",
54
- "@module-federation/sdk": "^0.21.6",
55
- "@rollup/pluginutils": "^5.1.0",
65
+ "@module-federation/dts-plugin": "^2.0.1",
66
+ "@module-federation/runtime": "^2.0.1",
67
+ "@module-federation/sdk": "^2.0.1",
68
+ "@rollup/pluginutils": "^5.3.0",
56
69
  "defu": "^6.1.4",
57
70
  "estree-walker": "^2",
58
71
  "magic-string": "^0.30.11",
59
72
  "pathe": "^1.1.2"
60
73
  },
61
74
  "devDependencies": {
75
+ "@changesets/cli": "^2.27.9",
62
76
  "@playwright/test": "^1.47.2",
63
77
  "@types/node": "^22.7.4",
78
+ "cjs-dep": "workspace:*",
64
79
  "husky": "^8.0.3",
65
- "microbundle": "^0.15.1",
66
80
  "mime-types": "^2.1.35",
67
- "prettier": "3.3.3",
68
- "pretty-quick": "^4.0.0",
69
- "rimraf": "^6.0.1",
81
+ "oxfmt": "^0.35.0",
70
82
  "rollup": "^4.47.1",
83
+ "tsdown": "^0.20.3",
71
84
  "vite": "^5.4.3",
72
- "vitest": "^2.1.1",
73
- "wait-on": "^8.0.1"
85
+ "vitest": "^2.1.1"
74
86
  }
75
87
  }
package/lib/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import { Plugin } from 'vite';
2
- import { ModuleFederationOptions } from './utils/normalizeModuleFederationOptions';
3
- declare function federation(mfUserOptions: ModuleFederationOptions): Plugin[];
4
- export { federation };