feat: add basic bundle analysis for dev builds (#1673)

This commit is contained in:
Tobias Åström
2025-01-30 13:59:23 +01:00
committed by GitHub
parent 08a4227596
commit 8467978604
22 changed files with 53 additions and 23 deletions

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<title>Nebula mashup</title>

View File

@@ -9,6 +9,7 @@ const commonjs = require('@rollup/plugin-commonjs');
const terser = require('@rollup/plugin-terser');
const jsxPlugin = require('@babel/plugin-transform-react-jsx');
const babelPreset = require('@babel/preset-env');
const { visualizer } = require('rollup-plugin-visualizer');
const resolveNative = require('./resolveNative');
@@ -195,6 +196,13 @@ const config = ({
})
: false,
],
...[
mode === 'development'
? visualizer({
filename: 'bundle-analysis.html',
})
: false,
],
].filter(Boolean),
},
output: output(),

View File

@@ -36,6 +36,7 @@
"postcss": "^8.5.1",
"rollup": "4.32.0",
"rollup-plugin-postcss": "4.0.2",
"rollup-plugin-visualizer": "5.14.0",
"yargs": "17.7.2"
},
"devDependencies": {

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
@@ -24,7 +24,10 @@
body {
background: linear-gradient(110deg, #92498f 0%, #45b3b2 100%);
font: normal 14px/16px 'Source Sans Pro', Arial, sans-serif;
font:
normal 14px/16px 'Source Sans Pro',
Arial,
sans-serif;
-webkit-font-smoothing: antialiased;
}

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
@@ -20,7 +20,10 @@
body {
color: #404040;
font: normal 14px/16px 'Source Sans Pro', Arial, sans-serif;
font:
normal 14px/16px 'Source Sans Pro',
Arial,
sans-serif;
-webkit-font-smoothing: antialiased;
background: linear-gradient(110deg, #91298c 0%, #45b3b2 100%);
}

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />

View File

@@ -15298,6 +15298,16 @@ rollup-plugin-sass@1.15.2:
resolve "^1.5.0"
sass "^1.7.2"
rollup-plugin-visualizer@5.14.0:
version "5.14.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-visualizer/-/rollup-plugin-visualizer-5.14.0.tgz#be82d43fb3c644e396e2d50ac8a53d354022d57c"
integrity sha512-VlDXneTDaKsHIw8yzJAFWtrzguoJ/LnQ+lMpoVfYJ3jJF4Ihe5oYLAqLklIK/35lgUY+1yEzCkHyZ1j4A5w5fA==
dependencies:
open "^8.4.0"
picomatch "^4.0.2"
source-map "^0.7.4"
yargs "^17.5.1"
rollup-pluginutils@^2.8.2:
version "2.8.2"
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e"
@@ -16065,6 +16075,11 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1:
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
source-map@^0.7.4:
version "0.7.4"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656"
integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==
spawn-wrap@^1.4.2:
version "1.4.3"
resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-1.4.3.tgz#81b7670e170cca247d80bf5faf0cfb713bdcf848"
@@ -18083,7 +18098,7 @@ yargs@14.2.2:
y18n "^4.0.0"
yargs-parser "^15.0.0"
yargs@17.7.2, yargs@^17.7.2:
yargs@17.7.2, yargs@^17.5.1, yargs@^17.7.2:
version "17.7.2"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269"
integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==