-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: Remote virtual module path * examples: nuxt(Unfinished) * feat: mf-manifest; Register remote on demand * doc: roadmap * doc: npm url * Delete src/utils/getLocalSharedImportMap_windows.ts --------- Co-authored-by: 张洪恩 <[email protected]>
- Loading branch information
1 parent
4291753
commit 56bf77c
Showing
58 changed files
with
6,323 additions
and
359 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
node_modules | ||
/lib | ||
dist | ||
.DS_Store | ||
.idea | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Nuxt dev/build outputs | ||
.output | ||
.data | ||
.nuxt | ||
.nitro | ||
.cache | ||
dist | ||
|
||
# Node dependencies | ||
node_modules | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
||
# Misc | ||
.DS_Store | ||
.fleet | ||
.idea | ||
|
||
# Local env files | ||
.env | ||
.env.* | ||
!.env.example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<template> | ||
<div> | ||
<h1>Nuxt host</h1> | ||
|
||
<p> | ||
Mode: <i> {{ runtimeConfig.app.buildId ? ' dev ' : ' prod ' }} mode </i> | ||
</p> | ||
<hr /> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
const runtimeConfig = useRuntimeConfig(); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { federation } from '@module-federation/vite'; | ||
import TopAwait from 'vite-plugin-top-level-await'; | ||
|
||
export default defineNuxtConfig({ | ||
compatibilityDate: '2024-04-03', | ||
debug: true, | ||
devtools: { enabled: true }, | ||
vite: { | ||
plugins: [ | ||
federation({ | ||
name: 'nuxremote', | ||
filename: 'remoteEntry.js', | ||
shared: { | ||
// vue: {}, | ||
}, | ||
runtimePlugins: ['./utils/mfPlugins'], | ||
exposes: { | ||
'./app': './app.vue', | ||
}, | ||
manifest: { | ||
fileName: '_nuxt/mf-manifest.json', | ||
}, | ||
}), | ||
new TopAwait(), | ||
], | ||
build: { | ||
target: 'chrome89', | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "examples-nuxt-vite-remote", | ||
"private": true, | ||
"type": "module", | ||
"scripts": { | ||
"build": "nuxt build", | ||
"dev": "NODE_OPTIONS=--experimental-vm-modules nuxt dev --experimental-vm-modules", | ||
"generate": "nuxt generate", | ||
"preview": "nuxt preview --port=3001", | ||
"postinstall": "nuxt prepare" | ||
}, | ||
"dependencies": { | ||
"@module-federation/vite": "workspace:*", | ||
"nuxt": "^3.13.0", | ||
"vue": "latest" | ||
}, | ||
"devDependencies": { | ||
"vite-plugin-top-level-await": "^1.4.4" | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "../.nuxt/tsconfig.server.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
// https://nuxt.com/docs/guide/concepts/typescript | ||
"extends": "./.nuxt/tsconfig.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,15 +22,13 @@ export default defineConfig({ | |
remote2: 'mfapp02@https://unpkg.com/mf-app-02/dist/remoteEntry.js', | ||
remote3: | ||
'remote1@https://unpkg.com/[email protected]/dist/mf-manifest.json', | ||
'@namespace/viteViteRemote': { | ||
entry: 'http://localhost:5176/remoteEntry.js', | ||
type: 'module', | ||
}, | ||
'@namespace/viteViteRemote': 'http://localhost:5176/mf-manifest.json', | ||
}, | ||
filename: 'remoteEntry.js', | ||
filename: 'remoteEntry-[hash].js', | ||
manifest: true, | ||
shared: { | ||
vue: {}, | ||
react: { | ||
'react/': { | ||
requiredVersion: '18', | ||
}, | ||
'react-dom': {}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.