-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b5b0a8d
Showing
19 changed files
with
9,047 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
NODE_ENV=development | ||
PUBLIC_PATH=http://localhost:3000/ | ||
|
||
# remotes | ||
|
||
REMOTE_CART=cart@http://localhost:3001/remoteEntry.js | ||
REMOTE_PRODUCTS=products@http://localhost:3002/remoteEntry.js | ||
REMOTE_PROFILE=profile@http://localhost:3003/remoteEntry.js |
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,8 @@ | ||
NODE_ENV=production | ||
PUBLIC_PATH=https://mfe-module-federation-vue-root.profile.app/ | ||
|
||
# remotes | ||
|
||
REMOTE_CART=cart@https://mfe-module-federation-vue-cart.netlify.app/remoteEntry.js | ||
REMOTE_PRODUCTS=products@https://mfe-module-federation-vue-products.netlify.app/remoteEntry.js | ||
REMOTE_PROFILE=profile@https://mfe-module-federation-vue-profile.netlify.app/remoteEntry.js |
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,23 @@ | ||
.DS_Store | ||
node_modules | ||
/dist | ||
|
||
|
||
# local env files | ||
.env.local | ||
.env.*.local | ||
|
||
# Log files | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
|
||
# Editor directories and files | ||
.idea | ||
.vscode | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
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,5 @@ | ||
module.exports = { | ||
presets: [ | ||
'@vue/cli-plugin-babel/preset' | ||
] | ||
} |
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,52 @@ | ||
{ | ||
"name": "@microfrontend-vue/root", | ||
"version": "0.1.0", | ||
"private": true, | ||
"scripts": { | ||
"serve": "vue-cli-service serve", | ||
"build": "vue-cli-service build --mode production", | ||
"lint": "vue-cli-service lint", | ||
"clean": "rm -rf dist", | ||
"start": "http-server -c-1 -p 9000 ./dist" | ||
}, | ||
"dependencies": { | ||
"core-js": "^3.6.5", | ||
"http-server": "^0.12.3", | ||
"vue": "^2.6.11", | ||
"vue-router": "^3.5.2", | ||
"vuetify": "^2.4.0" | ||
}, | ||
"devDependencies": { | ||
"@vue/cli-plugin-babel": "5.0.0-beta.2", | ||
"@vue/cli-plugin-eslint": "4.5.13", | ||
"@vue/cli-service": "5.0.0-beta.2", | ||
"babel-eslint": "^10.1.0", | ||
"eslint": "^6.7.2", | ||
"eslint-plugin-vue": "^6.2.2", | ||
"sass": "~1.32.0", | ||
"sass-loader": "^10.0.0", | ||
"vue-cli-plugin-vuetify": "~2.4.1", | ||
"vue-template-compiler": "^2.6.11", | ||
"vuetify-loader": "^1.7.0", | ||
"webpack": "^5.35.1" | ||
}, | ||
"eslintConfig": { | ||
"root": true, | ||
"env": { | ||
"node": true | ||
}, | ||
"extends": [ | ||
"plugin:vue/essential", | ||
"eslint:recommended" | ||
], | ||
"parserOptions": { | ||
"parser": "babel-eslint" | ||
}, | ||
"rules": {} | ||
}, | ||
"browserslist": [ | ||
"> 1%", | ||
"last 2 versions", | ||
"not dead" | ||
] | ||
} |
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,19 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | ||
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> | ||
<title><%= htmlWebpackPlugin.options.title %></title> | ||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css"> | ||
</head> | ||
<body> | ||
<noscript> | ||
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> | ||
</noscript> | ||
<div id="app"></div> | ||
<!-- built files will be auto injected --> | ||
</body> | ||
</html> |
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,39 @@ | ||
<template> | ||
<v-app> | ||
<Navbar @menuToggle="changeMenuState" /> | ||
|
||
<Menu :showMenu="drawer" /> | ||
|
||
<Main /> | ||
</v-app> | ||
</template> | ||
|
||
<script> | ||
import Navbar from "./components/Navbar.vue"; | ||
import Menu from "./components/Menu.vue"; | ||
import Main from "./components/Main.vue"; | ||
export default { | ||
name: "App", | ||
components: { | ||
Navbar, | ||
Menu, | ||
Main, | ||
}, | ||
data: () => ({ | ||
drawer: true, | ||
items: [ | ||
{ title: "Dashboard", icon: "mdi-view-dashboard" }, | ||
{ title: "Photos", icon: "mdi-image" }, | ||
{ title: "About", icon: "mdi-help-box" }, | ||
], | ||
}), | ||
methods: { | ||
changeMenuState() { | ||
this.drawer = !this.drawer; | ||
}, | ||
}, | ||
}; | ||
</script> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,13 @@ | ||
import Vue from "vue"; | ||
import App from "./App.vue"; | ||
import vuetify from "./plugins/vuetify"; | ||
import VueRouter from "vue-router"; | ||
import router from "./router"; | ||
Vue.config.productionTip = false; | ||
Vue.use(VueRouter); | ||
|
||
new Vue({ | ||
vuetify, | ||
router, | ||
render: (h) => h(App), | ||
}).$mount("#app"); |
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,66 @@ | ||
<template> | ||
<v-main> | ||
<v-container fluid> | ||
<router-view /> | ||
</v-container> | ||
</v-main> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: "Main", | ||
data: () => ({ | ||
ecosystem: [ | ||
{ | ||
text: "vuetify-loader", | ||
href: "https://github.com/vuetifyjs/vuetify-loader", | ||
}, | ||
{ | ||
text: "github", | ||
href: "https://github.com/vuetifyjs/vuetify", | ||
}, | ||
{ | ||
text: "awesome-vuetify", | ||
href: "https://github.com/vuetifyjs/awesome-vuetify", | ||
}, | ||
], | ||
importantLinks: [ | ||
{ | ||
text: "Documentation", | ||
href: "https://vuetifyjs.com", | ||
}, | ||
{ | ||
text: "Chat", | ||
href: "https://community.vuetifyjs.com", | ||
}, | ||
{ | ||
text: "Made with Vuetify", | ||
href: "https://madewithvuejs.com/vuetify", | ||
}, | ||
{ | ||
text: "Twitter", | ||
href: "https://twitter.com/vuetifyjs", | ||
}, | ||
{ | ||
text: "Articles", | ||
href: "https://medium.com/vuetify", | ||
}, | ||
], | ||
whatsNext: [ | ||
{ | ||
text: "Explore components", | ||
href: "https://vuetifyjs.com/components/api-explorer", | ||
}, | ||
{ | ||
text: "Select a layout", | ||
href: "https://vuetifyjs.com/getting-started/pre-made-layouts", | ||
}, | ||
{ | ||
text: "Frequently Asked Questions", | ||
href: "https://vuetifyjs.com/getting-started/frequently-asked-questions", | ||
}, | ||
], | ||
}), | ||
}; | ||
</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,40 @@ | ||
<template> | ||
<v-navigation-drawer app v-model="showMenu" absolute clipped> | ||
<v-list nav> | ||
<v-list-item | ||
v-for="item in items" | ||
:key="item.title" | ||
link | ||
:to="item.route" | ||
> | ||
<v-list-item-icon> | ||
<v-icon>{{ item.icon }}</v-icon> | ||
</v-list-item-icon> | ||
|
||
<v-list-item-content> | ||
<v-list-item-title>{{ item.title }}</v-list-item-title> | ||
</v-list-item-content> | ||
</v-list-item> | ||
</v-list> | ||
</v-navigation-drawer> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: "Menu", | ||
props: ["showMenu"], | ||
data() { | ||
return { | ||
items: [ | ||
{ title: "Products", icon: "mdi-tag-heart", route: "/products" }, | ||
{ title: "Cart", icon: "mdi-cart", route: "/cart" }, | ||
{ title: "My Account", icon: "mdi-account", route: "/profile" }, | ||
], | ||
right: null, | ||
}; | ||
}, | ||
}; | ||
</script> | ||
|
||
<style> | ||
</style> |
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,18 @@ | ||
<template> | ||
<v-app-bar app color="primary" dark clipped-left> | ||
<v-app-bar-nav-icon @click="menuToggle"></v-app-bar-nav-icon> | ||
<v-toolbar-title>Title</v-toolbar-title> | ||
</v-app-bar> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: "Navbar", | ||
data: () => ({ drawer: null }), | ||
methods: { | ||
menuToggle() { | ||
this.$emit("menuToggle"); | ||
}, | ||
}, | ||
}; | ||
</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 @@ | ||
import('./bootstrap'); |
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,7 @@ | ||
import Vue from 'vue'; | ||
import Vuetify from 'vuetify/lib/framework'; | ||
|
||
Vue.use(Vuetify); | ||
|
||
export default new Vuetify({ | ||
}); |
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,17 @@ | ||
import VueRouter from "vue-router"; | ||
|
||
const Cart = () => import("cart/Cart"); | ||
const Profile = () => import("profile/Profile"); | ||
const Products = () => import("products/Products"); | ||
|
||
const routes = [ | ||
{ path: "/cart", component: Cart }, | ||
{ path: "/products", component: Products }, | ||
{ path: "/profile", component: Profile }, | ||
]; | ||
|
||
const router = new VueRouter({ | ||
routes, | ||
}); | ||
|
||
export default router; |
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,29 @@ | ||
const ModuleFederationPlugin = require("webpack").container | ||
.ModuleFederationPlugin; | ||
const dependencies = require("./package.json").dependencies; | ||
|
||
console.log(); | ||
|
||
module.exports = { | ||
publicPath: process.env.PUBLIC_PATH, | ||
transpileDependencies: ["vuetify"], | ||
configureWebpack: { | ||
plugins: [ | ||
new ModuleFederationPlugin({ | ||
name: "root", | ||
filename: "remoteEntry.js", | ||
exposes: {}, | ||
remotes: { | ||
cart: process.env.REMOTE_CART, | ||
products: process.env.REMOTE_PRODUCTS, | ||
profile: process.env.REMOTE_PROFILE, | ||
}, | ||
shared: dependencies, | ||
}), | ||
], | ||
}, | ||
devServer: { | ||
port: 3000, | ||
progress: false, | ||
}, | ||
}; |
Oops, something went wrong.