forked from austintgriffith/ethblockart-galleass
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathwebpack.config.js
50 lines (48 loc) · 1.16 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
/**
* generates:
* - dist/main.js
* - dist/manifest.json
* - dist/webpack-bundle-analyzer-report.html
*/
const webpack = require("webpack");
const WebpackAssetsManifest = require("webpack-assets-manifest");
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
const remoteComponentConfig = require("./remote-component.config").resolve;
const externals = Object.keys(remoteComponentConfig).reduce(
(obj, key) => ({ ...obj, [key]: key }),
{}
);
module.exports = {
plugins: [
new webpack.EnvironmentPlugin({
"process.env.NODE_ENV": process.env.NODE_ENV
}),
new BundleAnalyzerPlugin({
analyzerMode: "static",
openAnalyzer: false,
reportFilename: "webpack-bundle-analyzer-report.html"
}),
new WebpackAssetsManifest()
],
entry: {
main: "./src/CustomStyle.js"
},
output: {
libraryTarget: "commonjs"
},
externals: {
...externals,
"remote-component.config.js": "remote-component.config.js"
},
module: {
rules: [
{
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: "babel-loader"
}
}
]
}
};