-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
76 lines (74 loc) · 1.87 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
var path = require('path')
const { ModuleFederationPlugin } = require('webpack').container
const httpNode = require('./webpack/http-node')
var serverConfig = {
target: httpNode,
entry: path.resolve(process.cwd(), 'src', 'noop.js'),
output: {
path: path.resolve(process.cwd(), 'dist'),
publicPath:
'https://api.github.com?owner=module-federation&repo=aegis-registry&filedir=dist&branch=main',
libraryTarget: 'commonjs'
},
devtool: 'source-map',
resolve: {
extensions: ['.js']
},
mode: 'development',
module: {
rules: [
{
test: /\.py$/,
use: [{ loader: 'python-webpack-loader' }]
},
{
test: /\.wasm$/,
type: 'webassembly/async'
}
]
},
experiments: {
asyncWebAssembly: true
},
optimization: {
chunkIds: 'deterministic' // To keep filename consistent between different modes (for example building only)
},
module: {
rules: [
{
test: /\.py$/,
loader: 'py-loader',
options: {
compiler: 'transcrypt'
}
},
{
test: /\.js?$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
}
]
},
plugins: [
new ModuleFederationPlugin({
name: 'remoteRegistry',
library: { type: 'commonjs-module' },
filename: 'remoteEntry.js',
exposes: {
'./default': './default/remote-entries'
// './order': './order/remote-entries',
// './payment': './payment/remote-entries',
// './shipping': './shipping/remote-entries',
// './activation-01': './activation-01/remote-entries',
// './multicast-grp-02': './multicast-grp-02/remote-entries',
// './bldg-01': './bldg-01/remote-entries'
}
})
]
}
module.exports = [serverConfig]