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
import { registerApplication, start } from 'single-spa' | |
registerApplication( | |
'vue', | |
() => import('./components/vue/index.js'), | |
() => location.pathname === "/vue" || location.pathname === "/" ? true : false | |
); | |
registerApplication( | |
'react', |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>MicroFrontEnds example</title> | |
<script src="./store.js"></script> | |
</head> | |
<body> | |
<div id="react"></div> |
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
{ | |
"name": "microfrontends-example", | |
"version": "1.0.0", | |
"description": "To demonstrate micro frontends using single SPA", | |
"main": "index.js", | |
"scripts": { | |
"start": "webpack-dev-server --open", | |
"build": "webpack --config webpack.config.js -p" | |
}, | |
"author": "Harsha Vardhan", |
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
{ | |
"name": "webpack-demo", | |
"version": "1.0.0", | |
"description": "To demonstrate the working of Webpack", | |
"main": "index.js", | |
"scripts": { | |
"dev": "webpack --mode development" | |
}, | |
"author": "Harsha Vardhan", | |
"license": "ISC", |
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
module.exports = { | |
"entry": "./source/index.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
const path = require('path') | |
module.exports = { | |
entry: { index: path.resolve(__dirname, "source", "index.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
const path = require('path') | |
module.exports = { | |
output: { path: path.resolve(__dirname, "build"), filename: "main.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
const HTMLWebpackPlugin = require('html-webpack-plugin') | |
const path = require('path') | |
module.exports = { | |
plugins: [ | |
new HTMLWebpackPlugin({ | |
template: path.resolve(__dirname, "source", "index.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
... | |
"scripts": { | |
"dev": "webpack --mode development", | |
"start": "webpack-dev-server --mode development --open" | |
} | |
... |
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
module.exports = { | |
module: { | |
rules: [ | |
{ | |
test: /\.filename1$/, | |
use: ["loader-b", "loader-a"] | |
}, | |
{ | |
test: /\.filename2$/, | |
use: ["loader-d", "loader-c"] |