-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.shell.config.js
51 lines (49 loc) · 1.15 KB
/
webpack.shell.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
const ModuleFederationPlugin = require("webpack/lib/container/ModuleFederationPlugin");
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const shell = {
entry: ["./shell/main", "./shell/styles.css"],
mode: "development",
devServer: {
contentBase: path.join(__dirname, "dist/shell"),
port: 5000
},
module: {
rules: [
{
test: /\.css$/i,
use: [MiniCssExtractPlugin.loader, 'css-loader'],
},
{
test: /\.ts$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
resolve: {
extensions: [ '.ts', '.js' ],
},
output: {
publicPath: "http://localhost:5000/",
path: path.join(__dirname, "dist/shell"),
filename: '[name].js'
},
plugins: [
new MiniCssExtractPlugin(),
new ModuleFederationPlugin({
name: "shell",
library: { type: "var", name: "shell" },
remotes: {
mf1: "mf1",
mf2: "mf2"
},
shared: ["rxjs"]
}),
new HtmlWebpackPlugin({
template: "./shell/index.html"
})
]
};
module.exports = shell;