Created
July 13, 2024 18:31
-
-
Save sullemanhossam/7d63a5f238f1747677d1173acbfb09f5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 { ModuleFederationPlugin } = require("webpack").container; | |
const { VueLoaderPlugin } = require("vue-loader"); | |
const { RemoteConfig, veinFinder } = require("remotes-config"); | |
const path = require("path"); | |
const pkg = require("./package.json"); | |
const HtmlWebpackPlugin = require("html-webpack-plugin"); | |
module.exports = { | |
entry: "./src/index", | |
mode: "development", | |
output: { | |
publicPath: "auto", | |
}, | |
resolve: { | |
extensions: [".vue", ".jsx", ".js", ".json"], | |
alias: { | |
vue: "@vue/runtime-dom", | |
}, | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.jsx?$/, | |
loader: "babel-loader", | |
exclude: /node_modules/, | |
options: { | |
presets: ["@babel/preset-react"], | |
}, | |
}, | |
{ | |
test: /\.vue$/, | |
use: "vue-loader", | |
}, | |
], | |
}, | |
plugins: [ | |
new ModuleFederationPlugin({ | |
...new RemoteConfig(pkg, ["react_counter", "store", "vue_counter"]), | |
}), | |
new HtmlWebpackPlugin({ | |
template: "./public/index.html", | |
}), | |
new VueLoaderPlugin(), | |
], | |
devServer: { | |
port: veinFinder(pkg.name), | |
static: { | |
directory: path.join(__dirname, "dist"), | |
}, | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment