-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ScriptedAlchemy
committed
Apr 21, 2024
1 parent
3d2f4c7
commit d26a55b
Showing
18 changed files
with
769 additions
and
9,914 deletions.
There are no files selected for viewing
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
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
88 changes: 88 additions & 0 deletions
88
dashboard-admin-react-rspack-material-ui/dashboard-app/rspack.config.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
const HtmlWebpackPlugin = require("html-webpack-plugin"); | ||
const ModuleFederationPlugin = require("webpack/lib/container/ModuleFederationPlugin"); | ||
const {dependencies} = require("./package.json"); | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
entry: "./src/index.js", | ||
output: { | ||
path: path.join(__dirname, './dist'), | ||
filename: 'bundle.js', | ||
publicPath: 'auto', | ||
uniqueName: 'dashboard' | ||
}, | ||
mode: "development", | ||
devServer: { | ||
port: 3001, | ||
hot: false, | ||
historyApiFallback: true, | ||
|
||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(js|jsx)?$/, | ||
exclude: /node_modules/, | ||
use: [ | ||
{ | ||
loader: "babel-loader", | ||
options: { | ||
presets: ["@babel/preset-env", "@babel/preset-react"], | ||
}, | ||
}, | ||
], | ||
}, | ||
{ | ||
test: /\.css$/i, | ||
use: ["style-loader", "css-loader"], | ||
}, | ||
], | ||
}, | ||
plugins: [ | ||
new HtmlWebpackPlugin({ | ||
template: "./public/index.html", | ||
favicon: "./public/favicon.ico", | ||
excludeChunks: ["Dashboard"] | ||
}), | ||
new ModuleFederationPlugin({ | ||
name: "Dashboard", | ||
filename: "remoteEntry.js", | ||
exposes: { | ||
"./Dashboard": "./src/Dashboard", | ||
}, | ||
shared: { | ||
...dependencies, | ||
"react": { | ||
singleton: true, | ||
requiredVersion: dependencies.react | ||
}, | ||
"react-dom": { | ||
singleton: true, | ||
requiredVersion: dependencies["react-dom"] | ||
}, | ||
"react-router-dom": { | ||
singleton: true, | ||
requiredVersion: dependencies["react-router-dom"] | ||
}, | ||
"@mui/material": { | ||
singleton: true, | ||
requiredVersion: dependencies["@mui/material"] | ||
}, | ||
"@mui/icons-material": { | ||
singleton: true, | ||
requiredVersion: dependencies["@mui/icons-material"] | ||
}, | ||
"@emotion/react": { | ||
singleton: true, | ||
requiredVersion: dependencies["@emotion/react"] | ||
}, | ||
|
||
}, | ||
}), | ||
], | ||
resolve: { | ||
// modules: [path.resolve(__dirname, 'src'), 'node_modules'], | ||
extensions: ['*', '.js', '.jsx'], | ||
}, | ||
target: "web", | ||
}; |
165 changes: 82 additions & 83 deletions
165
dashboard-admin-react-rspack-material-ui/dashboard-app/webpack.config.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,91 +1,90 @@ | ||
const HtmlWebpackPlugin = require("html-webpack-plugin"); | ||
const ModuleFederationPlugin = require("webpack/lib/container/ModuleFederationPlugin"); | ||
const { dependencies } = require("./package.json"); | ||
const {ModuleFederationPlugin} = require("@module-federation/enhanced"); | ||
const {dependencies} = require("./package.json"); | ||
const path = require('path'); | ||
|
||
// console.log(dependencies); | ||
module.exports = { | ||
entry: "./src/index.js", | ||
output: { | ||
path: path.join(__dirname, './dist'), | ||
filename: 'bundle.js', | ||
publicPath: 'auto' | ||
}, | ||
resolve: { | ||
extensions: [".js", ".jsx"], | ||
}, | ||
mode: "development", | ||
devServer: { | ||
port: 3001, | ||
hot: true, | ||
historyApiFallback: true, | ||
|
||
}, | ||
module: { | ||
rules: [ | ||
entry: "./src/index.js", | ||
output: { | ||
path: path.join(__dirname, './dist'), | ||
filename: 'bundle.js', | ||
publicPath: 'auto', | ||
uniqueName: 'dashapp' | ||
}, | ||
devtool: false, | ||
mode: "development", | ||
devServer: { | ||
port: 3001, | ||
hot: true, | ||
historyApiFallback: true, | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(js|jsx)?$/, | ||
exclude: /node_modules/, | ||
use: [ | ||
{ | ||
test: /\.(js|jsx)?$/, | ||
exclude: /node_modules/, | ||
use: [ | ||
{ | ||
loader: "babel-loader", | ||
options: { | ||
presets: ["@babel/preset-env", "@babel/preset-react"], | ||
}, | ||
loader: "babel-loader", | ||
options: { | ||
presets: ["@babel/preset-env", "@babel/preset-react"], | ||
}, | ||
], | ||
}, | ||
{ | ||
test: /\.css$/i, | ||
use: ["style-loader", "css-loader"], | ||
}, | ||
], | ||
}, | ||
plugins: [ | ||
new HtmlWebpackPlugin({ | ||
template: "./public/index.html", | ||
favicon: "./public/favicon.ico", | ||
|
||
}), | ||
new ModuleFederationPlugin({ | ||
name: "Dashboard", | ||
filename: "remoteEntry.js", | ||
exposes: { | ||
"./Dashboard": "./src/Dashboard", | ||
], | ||
}, | ||
{ | ||
test: /\.css$/i, | ||
use: ["style-loader", "css-loader"], | ||
}, | ||
], | ||
}, | ||
plugins: [ | ||
new HtmlWebpackPlugin({ | ||
template: "./public/index.html", | ||
favicon: "./public/favicon.ico", | ||
excludeChunks: ['Dashboard'] | ||
}), | ||
new ModuleFederationPlugin({ | ||
name: "Dashboard", | ||
filename: "remoteEntry.js", | ||
exposes: { | ||
"./Dashboard": "./src/Dashboard", | ||
}, | ||
shared: { | ||
// ...dependencies, | ||
"react": { | ||
singleton: true, | ||
requiredVersion: dependencies.react | ||
}, | ||
shared: { | ||
...dependencies, | ||
"react": { | ||
singleton: true, | ||
requiredVersion: dependencies.react | ||
}, | ||
"react-dom": { | ||
singleton: true, | ||
requiredVersion: dependencies["react-dom"] | ||
}, | ||
"react-router-dom": { | ||
singleton: true, | ||
requiredVersion: dependencies["react-router-dom"] | ||
}, | ||
"@mui/material": { | ||
singleton: true, | ||
requiredVersion: dependencies["@mui/material"] | ||
}, | ||
"@mui/icons-material": { | ||
singleton: true, | ||
requiredVersion: dependencies["@mui/icons-material"] | ||
}, | ||
"@emotion/react": { | ||
singleton: true, | ||
requiredVersion: dependencies["@emotion/react"] | ||
}, | ||
|
||
"react-dom": { | ||
singleton: true, | ||
requiredVersion: dependencies["react-dom"] | ||
}, | ||
}), | ||
], | ||
resolve: { | ||
modules: [path.resolve(__dirname, 'src'), 'node_modules'], | ||
extensions: ['*', '.js', '.jsx'], | ||
|
||
}, | ||
target: "web", | ||
}; | ||
"react-router-dom": { | ||
singleton: true, | ||
requiredVersion: dependencies["react-router-dom"] | ||
}, | ||
"@mui/material": { | ||
singleton: true, | ||
requiredVersion: dependencies["@mui/material"] | ||
}, | ||
"@mui/icons-material": { | ||
singleton: true, | ||
requiredVersion: dependencies["@mui/icons-material"] | ||
}, | ||
"@emotion/react": { | ||
singleton: true, | ||
requiredVersion: dependencies["@emotion/react"] | ||
}, | ||
"@nivo/":{ | ||
eager: false, | ||
singleton: true | ||
}, | ||
}, | ||
}), | ||
], | ||
resolve: { | ||
extensions: ['*', '.js', '.jsx'], | ||
}, | ||
target: "web", | ||
}; |
Oops, something went wrong.