add bundle analyzer

This commit is contained in:
Marin Petrunić
2020-04-03 09:32:19 +02:00
parent 2d3c6167db
commit c747634c4f
3 changed files with 283 additions and 13 deletions

23
webpack.bundle.config.js Normal file
View File

@ -0,0 +1,23 @@
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = {
entry: "./src/index.ts",
mode: "production",
output: {
filename: "../bundle/bundle.js"
},
node: {
fs: "empty"
},
resolve: {
extensions: [".ts", ".js"],
},
module: {
rules: [
{test: /\.ts$/, exclude: [/node_modules/], use: {loader: "babel-loader", options: require("./babel.web.config")}}
],
},
plugins: [
new BundleAnalyzerPlugin()
]
};