create-module-federation 0.0.0-1737428758075 → 0.0.0-fix-lazy-comile-20250928105735

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 (50) hide show
  1. package/README.md +40 -1
  2. package/dist/index.js +85 -64
  3. package/package.json +11 -8
  4. package/templates/consumer-modern-ts/modern.config.ts +15 -0
  5. package/templates/consumer-modern-ts/module-federation.config.ts.handlebars +12 -0
  6. package/templates/consumer-modern-ts/src/routes/page.tsx +21 -0
  7. package/templates/consumer-rsbuild-ts/module-federation.config.ts.handlebars +13 -0
  8. package/templates/consumer-rsbuild-ts/rsbuild.config.ts +8 -0
  9. package/templates/consumer-rsbuild-ts/src/App.tsx +12 -0
  10. package/templates/lib-common/module-federation.config.ts.handlebars +17 -0
  11. package/templates/lib-common/rslib.config.ts +52 -0
  12. package/templates/lib-common/src/index.css +53 -0
  13. package/templates/lib-common/src/index.tsx +19 -0
  14. package/templates/lib-common/tsconfig.json +14 -0
  15. package/templates/modern-common/.browserslistrc +5 -0
  16. package/templates/modern-common/.nvmrc +1 -0
  17. package/templates/modern-common/.vscode/extensions.json +14 -0
  18. package/templates/modern-common/.vscode/settings.json +88 -0
  19. package/templates/modern-common/README.md +37 -0
  20. package/templates/modern-common/biome.json +34 -0
  21. package/templates/modern-common/package.json.handlebars +45 -0
  22. package/templates/modern-common/src/modern-app-env.d.ts +3 -0
  23. package/templates/modern-common/src/modern.runtime.ts +3 -0
  24. package/templates/modern-common/src/routes/index.css +41 -0
  25. package/templates/modern-common/src/routes/layout.tsx +9 -0
  26. package/templates/modern-common/tsconfig.json +15 -0
  27. package/templates/provider-modern-ts/modern.config.ts +18 -0
  28. package/templates/provider-modern-ts/module-federation.config.ts.handlebars +12 -0
  29. package/templates/provider-modern-ts/src/components/ProviderComponent.css +52 -0
  30. package/templates/provider-modern-ts/src/components/ProviderComponent.tsx +19 -0
  31. package/templates/provider-modern-ts/src/routes/page.tsx +21 -0
  32. package/templates/provider-rsbuild-ts/module-federation.config.ts.handlebars +12 -0
  33. package/templates/provider-rsbuild-ts/rsbuild.config.ts +11 -0
  34. package/templates/provider-rsbuild-ts/src/App.tsx +12 -0
  35. package/templates/provider-rsbuild-ts/src/components/ProviderComponent.css +52 -0
  36. package/templates/provider-rsbuild-ts/src/components/ProviderComponent.tsx +19 -0
  37. package/templates/provider-rslib-storybook-ts/.storybook/main.ts.handlebars +41 -0
  38. package/templates/provider-rslib-storybook-ts/README.md +27 -0
  39. package/templates/provider-rslib-storybook-ts/package.json.handlebars +50 -0
  40. package/templates/provider-rslib-storybook-ts/stories/Index.stories.tsx +11 -0
  41. package/templates/provider-rslib-ts/README.md +19 -0
  42. package/templates/provider-rslib-ts/package.json.handlebars +35 -0
  43. package/templates/rsbuild-common/README.md +29 -0
  44. package/templates/rsbuild-common/package.json.handlebars +22 -0
  45. package/templates/rsbuild-common/public/.gitkeep +0 -0
  46. package/templates/rsbuild-common/src/App.css +15 -0
  47. package/templates/rsbuild-common/src/bootstrap.tsx +13 -0
  48. package/templates/rsbuild-common/src/env.d.ts +1 -0
  49. package/templates/rsbuild-common/src/index.tsx +1 -0
  50. package/templates/rsbuild-common/tsconfig.json +26 -0
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "{{ mfName }}",
3
+ "version": "0.0.0",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": {
7
+ "types": "./dist/index.d.ts",
8
+ "import": "./dist/index.js"
9
+ }
10
+ },
11
+ "module": "./dist/index.js",
12
+ "types": "./dist/index.d.ts",
13
+ "files": [
14
+ "dist"
15
+ ],
16
+ "scripts": {
17
+ "build": "rslib build",
18
+ "dev": "rslib build --watch",
19
+ "mf-dev": "rslib mf-dev"
20
+ },
21
+ "devDependencies": {
22
+ "@rsbuild/core": "^1.3.21",
23
+ "@rsbuild/plugin-react": "^1.1.1",
24
+ "@rslib/core": ">=0.9.0",
25
+ "@types/react": "^18.3.11",
26
+ "react": "^18.3.1",
27
+ "typescript": "^5.7.3",
28
+ "@types/node": "^22.13.9",
29
+ "@module-federation/rsbuild-plugin":"^{{mfVersion}}"
30
+ },
31
+ "peerDependencies": {
32
+ "react": ">=16.9.0",
33
+ "react-dom": ">=16.9.0"
34
+ }
35
+ }
@@ -0,0 +1,29 @@
1
+ # Rsbuild Project
2
+
3
+ ## Setup
4
+
5
+ Install the dependencies:
6
+
7
+ ```bash
8
+ pnpm install
9
+ ```
10
+
11
+ ## Get Started
12
+
13
+ Start the dev server:
14
+
15
+ ```bash
16
+ pnpm dev
17
+ ```
18
+
19
+ Build the app for production:
20
+
21
+ ```bash
22
+ pnpm build
23
+ ```
24
+
25
+ Preview the production build locally:
26
+
27
+ ```bash
28
+ pnpm preview
29
+ ```
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "{{ mfName }}",
3
+ "private": true,
4
+ "version": "1.0.0",
5
+ "scripts": {
6
+ "dev": "rsbuild dev --open",
7
+ "build": "rsbuild build",
8
+ "preview": "rsbuild preview"
9
+ },
10
+ "dependencies": {
11
+ "react": "^18.3.1",
12
+ "react-dom": "^18.3.1"
13
+ },
14
+ "devDependencies": {
15
+ "@rsbuild/core": "^1.2.15",
16
+ "@rsbuild/plugin-react": "^1.1.1",
17
+ "@types/react": "^18.3.11",
18
+ "@types/react-dom": "~18.3.1",
19
+ "typescript": "^5.7.2",
20
+ "@module-federation/rsbuild-plugin":"^{{mfVersion}}"
21
+ }
22
+ }
File without changes
@@ -0,0 +1,15 @@
1
+ body {
2
+ margin: 0;
3
+ color: #fff;
4
+ font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
5
+ background-image: linear-gradient(to bottom, #020917, #101725);
6
+ }
7
+
8
+ .content {
9
+ display: flex;
10
+ min-height: 100vh;
11
+ line-height: 1.1;
12
+ text-align: center;
13
+ flex-direction: column;
14
+ justify-content: center;
15
+ }
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom/client';
3
+ import App from './App';
4
+
5
+ const rootEl = document.getElementById('root');
6
+ if (rootEl) {
7
+ const root = ReactDOM.createRoot(rootEl);
8
+ root.render(
9
+ <React.StrictMode>
10
+ <App />
11
+ </React.StrictMode>,
12
+ );
13
+ }
@@ -0,0 +1 @@
1
+ /// <reference types="@rsbuild/core/types" />
@@ -0,0 +1 @@
1
+ import('./bootstrap');
@@ -0,0 +1,26 @@
1
+ {
2
+ "compilerOptions": {
3
+ "lib": ["DOM", "ES2020"],
4
+ "jsx": "react-jsx",
5
+ "target": "ES2020",
6
+ "noEmit": true,
7
+ "skipLibCheck": true,
8
+ "useDefineForClassFields": true,
9
+
10
+ /* modules */
11
+ "module": "ESNext",
12
+ "isolatedModules": true,
13
+ "resolveJsonModule": true,
14
+ "moduleResolution": "Bundler",
15
+ "allowImportingTsExtensions": true,
16
+
17
+ /* type checking */
18
+ "strict": true,
19
+ "noUnusedLocals": true,
20
+ "noUnusedParameters": true,
21
+ "paths": {
22
+ "*": ["./@mf-types/*"]
23
+ }
24
+ },
25
+ "include": ["src"]
26
+ }