-
-
Save kahboom/f771a5674d6f419f61c9c4e9ceeb51e7 to your computer and use it in GitHub Desktop.
Module Federation part of Kaoto: https://github.com/KaotoIO/kaoto-ui
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
{ | |
"compilerOptions": { | |
"declaration": true, | |
"esModuleInterop": true, | |
"importHelpers": true, | |
"jsx": "react-jsx", | |
"lib": ["dom", "esnext"], | |
"module": "esnext", | |
"moduleResolution": "node", | |
"noFallthroughCasesInSwitch": true, | |
"noImplicitAny": true, | |
"noImplicitReturns": true, | |
"noUnusedLocals": true, | |
"noUnusedParameters": true, | |
"outDir": "dist", | |
"sourceMap": true, | |
"strict": true, | |
"target": "es6", | |
}, | |
"exclude": [ | |
"dist", | |
"node_modules", | |
"**/*.stories.tsx", | |
"**/*.test.ts*", | |
] | |
} |
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
Show hidden characters
{ | |
"extends": "./tsconfig.build.json", | |
"compilerOptions": { | |
"allowJs": false, | |
"baseUrl": ".", | |
"declaration": true, | |
"paths": { | |
"*": ["*", "types/*"] | |
}, | |
"typeRoots": ["./node_modules/@types"], | |
}, | |
"include": ["src", "webpack.common.js", "setupTests.ts"] | |
} |
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'); | |
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin'); | |
const { dependencies, federatedModuleName } = require('./package.json'); | |
const webpack = require('webpack'); | |
// host app webpack | |
module.exports = () => { | |
return { | |
entry: { | |
app: path.resolve(__dirname, 'src', 'index.tsx'), | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.tsx?$/, | |
exclude: /node_modules/, | |
use: [ | |
{ | |
loader: 'dts-loader', | |
options: { | |
name: federatedModuleName, | |
exposes: { | |
'./integrationJson': './src/store/integrationJsonStore.tsx', | |
'./visualizationStore': './src/store/visualizationStore.tsx', | |
}, | |
typesOutputDir: '.wp_federation', | |
}, | |
}, | |
], | |
}, | |
], | |
}, | |
output: { | |
path: path.resolve(__dirname, 'dist'), | |
}, | |
plugins: [ | |
new webpack.container.ModuleFederationPlugin({ | |
name: federatedModuleName, | |
exposes: { | |
'./integrationJson': './src/store/integrationJsonStore.tsx', | |
'./visualizationStore': './src/store/visualizationStore.tsx', | |
}, | |
shared: { | |
react: { | |
eager: true, | |
singleton: true, | |
requiredVersion: dependencies['react'], | |
}, | |
'react-dom': { | |
eager: true, | |
singleton: true, | |
requiredVersion: dependencies['react-dom'], | |
}, | |
'react-router-dom': { | |
singleton: true, | |
eager: true, | |
requiredVersion: dependencies['react-router-dom'], | |
}, | |
}, | |
}), | |
], | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment