forked from manfredsteyer/snake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
44 lines (43 loc) · 1.22 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
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://jbroni.github.io/snake/",
filename: "[name].js",
path: __dirname + "/dist/strategy",
chunkFilename: "[id].[chunkhash].js",
},
mode: "production",
};
module.exports = shellConfig;