-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathwebpack.config.js
48 lines (47 loc) · 1.26 KB
/
webpack.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
const ModuleFederationPlugin = require("webpack/lib/container/ModuleFederationPlugin");
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
const shellConfig = {
entry: ["./src/app/strategy/custom.strategy.ts"],
resolve: {
mainFields: ["browser", "module", "main"],
extensions: [".ts", ".tsx", ".js"],
},
module: {
rules: [
{
test: /\.ts$/,
loader: "babel-loader",
exclude: /node_modules/,
options: {
presets: ["@babel/preset-typescript"],
plugins: [
"@babel/plugin-proposal-class-properties"
]
},
},
]
},
plugins: [
new CleanWebpackPlugin(),
new ModuleFederationPlugin({
name: "strategy",
library: { type: "var", name: "strategy" },
filename: "remoteEntry.js",
exposes: {
Strategy: './src/app/strategy/custom.strategy.ts',
}
}),
new CopyPlugin({ patterns: [
{ from: 'public', to: '' },
]}),
],
output: {
publicPath: "https://manfredsteyer.github.io/snake/",
filename: "[name].js",
path: __dirname + "/dist/strategy",
chunkFilename: "[id].[chunkhash].js"
},
mode: "production"
};
module.exports = shellConfig;