Skip to content

Commit

Permalink
fix(phone/tooling): add mf plugin to dev webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
itschip committed Oct 1, 2023
1 parent e9b5464 commit 9be9682
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions apps/phone/config/webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
const CopyPlugin = require('copy-webpack-plugin');
const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');
const deps = require('../package.json').dependencies;

module.exports = () => ({
entry: './src/bootstrap.ts',
Expand Down Expand Up @@ -47,6 +49,25 @@ module.exports = () => ({
],
},
plugins: [
new ModuleFederationPlugin({
name: 'layout',
filename: 'remoteEntry.js',
exposes: {
'./ui': './src/ui/components/index',
},
remotes: {},
shared: {
...deps,
react: {
singleton: true,
requiredVersion: deps.react,
},
'react-dom': {
singleton: true,
requiredVersion: deps['react-dom'],
},
},
}),
new HtmlWebpackPlugin({
template: './public/index.html',
}),
Expand Down

0 comments on commit 9be9682

Please sign in to comment.