Skip to content

Commit

Permalink
update mfe config
Browse files Browse the repository at this point in the history
  • Loading branch information
Kivylius committed Jan 28, 2024
1 parent c429ce7 commit f3d111c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rspack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { HtmlRspackPlugin, container: {ModuleFederationPlugin} } = require('@rspack/core');
const path = require('path');
const deps = require('./package.json').dependencies;
const package = require('./package.json');

module.exports = {
entry: './src/index',
Expand Down Expand Up @@ -44,21 +44,21 @@ module.exports = {
},
plugins: [
new ModuleFederationPlugin({
name: 'plugin',
name: package.name,
filename: 'remoteEntry.js',
exposes: {
'./Plugin': './src/App',
},
shared: {
react: {
requiredVersion: deps.react,
requiredVersion: package.dependencies.react,
import: 'react', // the "react" package will be used a provided and fallback module
shareKey: 'react', // under this name the shared module will be placed in the share scope
shareScope: 'default', // share scope with this name will be used
singleton: true, // only a single version of the shared module is allowed
},
'react-dom': {
requiredVersion: deps['react-dom'],
requiredVersion: package.dependencies['react-dom'],
singleton: true, // only a single version of the shared module is allowed
},
},
Expand Down

0 comments on commit f3d111c

Please sign in to comment.