Skip to content

Commit

Permalink
Fix demos don't allow to visualize source maps
Browse files Browse the repository at this point in the history
  • Loading branch information
fzaninotto committed Jun 26, 2023
1 parent 4fdeede commit 8009ec8
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 64 deletions.
3 changes: 1 addition & 2 deletions examples/crm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@
"@types/react-beautiful-dnd": "^13.0.0",
"@types/react-dom": "^17.0.9",
"@vitejs/plugin-react": "^2.2.0",
"source-map-explorer": "^2.0.0",
"rollup-plugin-visualizer": "^5.9.2",
"typescript": "^5.1.3",
"vite": "^3.2.0",
"web-vitals": "^1.0.1"
},
"scripts": {
"analyze": "source-map-explorer './dist/assets/*.js'",
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
Expand Down
9 changes: 8 additions & 1 deletion examples/crm/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineConfig } from 'vite';
import path from 'path';
import fs from 'fs';
import react from '@vitejs/plugin-react';
import visualizer from 'rollup-plugin-visualizer';

const packages = fs.readdirSync(path.resolve(__dirname, '../../packages'));
const aliases = packages.reduce((acc, dirName) => {
Expand All @@ -20,7 +21,13 @@ const aliases = packages.reduce((acc, dirName) => {

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
plugins: [
react(),
visualizer({
open: process.env.NODE_ENV !== 'CI',
filename: './dist/stats.html',
}),
],
define: {
'process.env': process.env,
},
Expand Down
3 changes: 1 addition & 2 deletions examples/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"recharts": "^2.1.15"
},
"scripts": {
"analyze": "source-map-explorer 'dist/assets/*.js'",
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
Expand All @@ -52,7 +51,7 @@
"@types/react-dom": "^17.0.9",
"@vitejs/plugin-react": "^2.2.0",
"rewire": "^5.0.0",
"source-map-explorer": "^2.0.0",
"rollup-plugin-visualizer": "^5.9.2",
"typescript": "^5.1.3",
"vite": "^3.2.0"
}
Expand Down
9 changes: 8 additions & 1 deletion examples/demo/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineConfig } from 'vite';
import path from 'path';
import fs from 'fs';
import react from '@vitejs/plugin-react';
import visualizer from 'rollup-plugin-visualizer';

const packages = fs.readdirSync(path.resolve(__dirname, '../../packages'));
const aliases = packages.reduce((acc, dirName) => {
Expand All @@ -20,7 +21,13 @@ const aliases = packages.reduce((acc, dirName) => {

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
plugins: [
react(),
visualizer({
open: process.env.NODE_ENV !== 'CI',
filename: './dist/stats.html',
}),
],
define: {
'process.env': process.env,
},
Expand Down
91 changes: 33 additions & 58 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8012,15 +8012,6 @@ __metadata:
languageName: node
linkType: hard

"btoa@npm:^1.2.1":
version: 1.2.1
resolution: "btoa@npm:1.2.1"
bin:
btoa: bin/btoa.js
checksum: 557b9682e40a68ae057af1b377e28884e6ff756ba0f499fe0f8c7b725a5bfb5c0d891604ac09944dbe330c9d43fb3976fef734f9372608d0d8e78a30eda292ae
languageName: node
linkType: hard

"buffer-crc32@npm:~0.2.3":
version: 0.2.13
resolution: "buffer-crc32@npm:0.2.13"
Expand Down Expand Up @@ -9866,7 +9857,7 @@ __metadata:
react-router-dom: ^6.1.0
recharts: ^2.1.15
rewire: ^5.0.0
source-map-explorer: ^2.0.0
rollup-plugin-visualizer: ^5.9.2
typescript: ^5.1.3
vite: ^3.2.0
languageName: unknown
Expand Down Expand Up @@ -10148,7 +10139,7 @@ __metadata:
languageName: node
linkType: hard

"duplexer@npm:^0.1.1, duplexer@npm:^0.1.2":
"duplexer@npm:^0.1.1":
version: 0.1.2
resolution: "duplexer@npm:0.1.2"
checksum: c57bcd4bdf7e623abab2df43a7b5b23d18152154529d166c1e0da6bee341d84c432d157d7e97b32fecb1bf3a8b8857dd85ed81a915789f550637ed25b8e64fc2
Expand Down Expand Up @@ -10548,7 +10539,7 @@ __metadata:
languageName: node
linkType: hard

"escape-html@npm:^1.0.3, escape-html@npm:~1.0.3":
"escape-html@npm:~1.0.3":
version: 1.0.3
resolution: "escape-html@npm:1.0.3"
checksum: 524c739d776b36c3d29fa08a22e03e8824e3b2fd57500e5e44ecf3cc4707c34c60f9ca0781c0e33d191f2991161504c295e98f68c78fe7baa6e57081ec6ac0a3
Expand Down Expand Up @@ -12383,7 +12374,7 @@ __metadata:
languageName: node
linkType: hard

"glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6":
"glob@npm:^7.1.3, glob@npm:^7.1.4":
version: 7.2.0
resolution: "glob@npm:7.2.0"
dependencies:
Expand Down Expand Up @@ -12584,15 +12575,6 @@ __metadata:
languageName: node
linkType: hard

"gzip-size@npm:^6.0.0":
version: 6.0.0
resolution: "gzip-size@npm:6.0.0"
dependencies:
duplexer: ^0.1.2
checksum: 4ccb924626c82125897a997d1c84f2377846a6ef57fbee38f7c0e6b41387fba4d00422274440747b58008b5d60114bac2349c2908e9aba55188345281af40a3f
languageName: node
linkType: hard

"handlebars@npm:^4.7.7":
version: 4.7.7
resolution: "handlebars@npm:4.7.7"
Expand Down Expand Up @@ -16847,7 +16829,7 @@ __metadata:
languageName: node
linkType: hard

"open@npm:^7.0.3, open@npm:^7.3.1":
"open@npm:^7.0.3":
version: 7.4.2
resolution: "open@npm:7.4.2"
dependencies:
Expand Down Expand Up @@ -18621,7 +18603,7 @@ __metadata:
react-error-boundary: ^3.1.4
react-router: ^6.1.0
react-router-dom: ^6.1.0
source-map-explorer: ^2.0.0
rollup-plugin-visualizer: ^5.9.2
typescript: ^5.1.3
vite: ^3.2.0
web-vitals: ^1.0.1
Expand Down Expand Up @@ -19846,6 +19828,25 @@ __metadata:
languageName: node
linkType: hard

"rollup-plugin-visualizer@npm:^5.9.2":
version: 5.9.2
resolution: "rollup-plugin-visualizer@npm:5.9.2"
dependencies:
open: ^8.4.0
picomatch: ^2.3.1
source-map: ^0.7.4
yargs: ^17.5.1
peerDependencies:
rollup: 2.x || 3.x
peerDependenciesMeta:
rollup:
optional: true
bin:
rollup-plugin-visualizer: dist/bin/cli.js
checksum: e6280bed797084e9f9ee06726e46706e32854fc7647c5c5bcec68a9be8ca8e6fbf7f8a0b2f76255e9df72e84135a7d57eb2662b6cfd68496a1ef60fa33597eaf
languageName: node
linkType: hard

"rollup@npm:^2.79.1":
version: 2.79.1
resolution: "rollup@npm:2.79.1"
Expand Down Expand Up @@ -20429,29 +20430,6 @@ __metadata:
languageName: node
linkType: hard

"source-map-explorer@npm:^2.0.0":
version: 2.5.2
resolution: "source-map-explorer@npm:2.5.2"
dependencies:
btoa: ^1.2.1
chalk: ^4.1.0
convert-source-map: ^1.7.0
ejs: ^3.1.5
escape-html: ^1.0.3
glob: ^7.1.6
gzip-size: ^6.0.0
lodash: ^4.17.20
open: ^7.3.1
source-map: ^0.7.3
temp: ^0.9.4
yargs: ^16.2.0
bin:
sme: bin/cli.js
source-map-explorer: bin/cli.js
checksum: f70fcee4e569bfece11868d230db4e8d9a683b25d579f318c1384de48cb62e1132917bef975451b5c93dcad1704506bef5c1d03f05d5b3595315a852202a0a4c
languageName: node
linkType: hard

"source-map-js@npm:^1.0.2":
version: 1.0.2
resolution: "source-map-js@npm:1.0.2"
Expand Down Expand Up @@ -20510,6 +20488,13 @@ __metadata:
languageName: node
linkType: hard

"source-map@npm:^0.7.4":
version: 0.7.4
resolution: "source-map@npm:0.7.4"
checksum: dc0cf3768fe23c345ea8760487f8c97ef6fca8a73c83cd7c9bf2fde8bc2c34adb9c0824d6feb14bc4f9e37fb522e18af621543f1289038a66ac7586da29aa7dc
languageName: node
linkType: hard

"sourcemap-codec@npm:^1.4.4, sourcemap-codec@npm:^1.4.8":
version: 1.4.8
resolution: "sourcemap-codec@npm:1.4.8"
Expand Down Expand Up @@ -21115,16 +21100,6 @@ __metadata:
languageName: node
linkType: hard

"temp@npm:^0.9.4":
version: 0.9.4
resolution: "temp@npm:0.9.4"
dependencies:
mkdirp: ^0.5.1
rimraf: ~2.6.2
checksum: 7a1cd75efa65b9ca97fc0dfa752673842d23fa41d9c641a447d86ca986eb7662f0d17771e1edf8d0149e76de3c6e7005faf2ccaa3baf64811c86d1d1a951dda7
languageName: node
linkType: hard

"tempy@npm:^1.0.1":
version: 1.0.1
resolution: "tempy@npm:1.0.1"
Expand Down Expand Up @@ -22769,7 +22744,7 @@ __metadata:
languageName: node
linkType: hard

"yargs@npm:^17.3.1, yargs@npm:^17.6.2":
"yargs@npm:^17.3.1, yargs@npm:^17.5.1, yargs@npm:^17.6.2":
version: 17.7.2
resolution: "yargs@npm:17.7.2"
dependencies:
Expand Down

0 comments on commit 8009ec8

Please sign in to comment.