-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.config.js
63 lines (58 loc) · 1.47 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
// const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
const { ModuleFederationPlugin } = require('webpack').container;
const { WatchIgnorePlugin } = require('webpack')
require('@signalk/server-admin-ui-dependencies')
const packageJson = require('./package')
console.log(packageJson.name.replace(/[-@/]/g, '_'))
module.exports = {
entry: './src/index',
mode: 'development',
output: {
path: path.resolve(__dirname, 'public')
},
module: {
rules: [
{
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
options: {
presets: ['@babel/preset-react'],
},
},
{
test: /\.css$/,
use: [
'style-loader',
'css-loader'
]
},
{
test: /\.(png|svg|jpg|gif)$/,
loader:
'file-loader',
options: {
name: '[path][name].[ext]',
},
}
],
},
plugins: [
new ModuleFederationPlugin({
name: 'Calibration',
library: { type: 'var', name: packageJson.name.replace(/[-@/]/g, '_') },
filename: 'remoteEntry.js',
exposes: {
'./PluginConfigurationPanel': './src/components/PluginConfigurationPanel',
},
shared: [{ react: { singleton: true } }],
}),
new WatchIgnorePlugin({
paths: [path.resolve(__dirname, 'public/')]
})
// new HtmlWebpackPlugin({
// template: './public/index.html',
// }),
],
};