diff --git a/src/packages/excalidraw/package.json b/src/packages/excalidraw/package.json
index 1ee9167e..1a7876bc 100644
--- a/src/packages/excalidraw/package.json
+++ b/src/packages/excalidraw/package.json
@@ -63,6 +63,7 @@
"repository": "https://github.com/excalidraw/excalidraw",
"scripts": {
"build:umd": "cross-env NODE_ENV=production webpack --config webpack.prod.config.js",
+ "build:umd:withAnalyzer": "cross-env NODE_ENV=production ANALYZER=true webpack --config webpack.prod.config.js",
"pack": "npm run build:umd && npm pack"
}
}
diff --git a/src/packages/excalidraw/webpack.prod.config.js b/src/packages/excalidraw/webpack.prod.config.js
index d7482e44..b6ad5470 100644
--- a/src/packages/excalidraw/webpack.prod.config.js
+++ b/src/packages/excalidraw/webpack.prod.config.js
@@ -1,9 +1,8 @@
const path = require("path");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const TerserPlugin = require("terser-webpack-plugin");
-// uncomment to analyze
-// const BundleAnalyzerPlugin = require("webpack-bundle-analyzer")
-// .BundleAnalyzerPlugin;
+const BundleAnalyzerPlugin = require("webpack-bundle-analyzer")
+ .BundleAnalyzerPlugin;
module.exports = {
mode: "production",
@@ -94,8 +93,7 @@ module.exports = {
},
plugins: [
new MiniCssExtractPlugin({ filename: "[name].css" }),
- // uncomment to analyze
- //new BundleAnalyzerPlugin(),
+ ...(process.env.ANALYZER === "true" ? [new BundleAnalyzerPlugin()] : []),
],
externals: {
react: {
diff --git a/src/packages/utils/README.md b/src/packages/utils/README.md
index 5366f1f7..d1fe9e29 100644
--- a/src/packages/utils/README.md
+++ b/src/packages/utils/README.md
@@ -30,7 +30,7 @@ import { exportToSvg, exportToBlob } from "@excalidraw/utils";
To use it in a browser directly:
```html
-
+