Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyperkid123 authored Apr 4, 2024
1 parent 839c3f4 commit 7807eda
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ npx webpack init
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
},
"include": ["src/**/*ts", "src/**/*ts"]
"include": ["src/**/*tsx", "src/**/*ts"]
}

```
Expand Down Expand Up @@ -105,7 +105,7 @@ const isProduction = process.env.NODE_ENV == "production";
const stylesHandler = MiniCssExtractPlugin.loader;

const config = {
entry: "./src/index.tsx",
entry: "./src/index.ts",
output: {
path: path.resolve(__dirname, "dist"),
},
Expand All @@ -118,7 +118,24 @@ const config = {
template: "index.html",
}),
new MiniCssExtractPlugin(),

new ModuleFederationPlugin({
name: 'shell',
filename: isProduction ? 'shell-entry.[contenthash].js' : 'shell-entry.js',
shared: [
{
react: {
requiredVersion: '*',
singleton: true,
},
'react-dom': {
requiredVersion: '*',
singleton: true,
},
'@scalprum/react-core': { singleton: true, requiredVersion: '*' },
'@openshift/dynamic-plugin-sdk': { singleton: true, requiredVersion: '*' },
},
],
}),
],
module: {
rules: [
Expand Down Expand Up @@ -168,7 +185,13 @@ module.exports = () => {
return config;
};
```
12. Change the `index.ts` file extention to `index.tsx` and edit the `index.tsx` file to match the following example:
12. Change the `index.ts` file to match the following example:

```ts
import('./bootstrap.tsx')
```
Create a `bootstrap.tsx` file with this code:

```js

import React from 'react';
Expand Down

0 comments on commit 7807eda

Please sign in to comment.