-
Notifications
You must be signed in to change notification settings - Fork 233
/
webpack.config.dist.js
36 lines (35 loc) · 954 Bytes
/
webpack.config.dist.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
const webpack = require("webpack");
const path = require("path");
const Visualizer = require("webpack-visualizer-plugin");
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
module.exports = {
context: path.join(__dirname, "src"),
entry: "./index.js",
output: {
path: __dirname + "/dist/",
filename: "rd3g.bundle.js",
},
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules|sandbox/,
loader: "babel-loader",
},
],
},
resolve: {
extensions: [".js", ".jsx"],
},
plugins: [
new BundleAnalyzerPlugin({
analyzerMode: "static",
reportFilename: "../gen-docs/bundle-analyser-stats.html",
openAnalyzer: true,
}),
new Visualizer({ filename: "../gen-docs/visualizer-stats.html" }),
new webpack.DefinePlugin({
rd3gRunningVersion: JSON.stringify(process.env.npm_package_version || "unknown"),
}),
],
};