This repository consist complete webpack and typescript setup for react application. Also included Module federation part including one micro-app build with webpack(react).
- webpack folder contain 4 file of webpack.config
- webpack.common.js : it is common config for both
dev
andprod
environment. - webpack.dev.js : it is for development environment.
- webpack.prod.js : it is for production environment.
- webpack.config.js : it is main config file which will be served.
- webpack.common.js : it is common config for both
- .babelrc : This file content the babel configuration of for converting ES6 code to backword compatible code of javascript.
- .eslintrc : file configure for linting
- .prettierrc: file containing configuration for formatting with prettier.
- microapp1 : it is one different react application which can be integrated with main application with MF.
- src : it is source folder for main application.
webpack.config files are written in ES6 syntax instead of ES5. For that I have updated package.json file, with type: module
property.
It contain app microapp1
which is mini application which can be used inside of webpack main template. This is also form of Micro-frontend where one app is integrated with another using Module Federation plugin. This can be improved for further more apps.
Application have package.json which have dependencies and dev-dependencies for main app and micro app.
- clone the repo
yarn install
for installing dependencies.- cd microapp1
yarn install
in microapp1- come back main folder
cd ..
yarn run main
to start both application- to create a build run build command in both the apps (refer package.json for more)