vite-bundle-explorer
Advanced tools
+1
-1
| { | ||
| "name": "vite-bundle-explorer", | ||
| "description": "Bundle analyzer and visualizer tool for Vite", | ||
| "version": "0.3.0", | ||
| "version": "0.3.1", | ||
| "type": "module", | ||
@@ -6,0 +6,0 @@ "homepage": "https://github.com/Solant/vite-bundle-explorer#readme", |
@@ -14,13 +14,13 @@ import { join } from 'node:path'; | ||
| const emitJson = options?.emitJson ?? false; | ||
| let root = ''; | ||
| let root = process.cwd(); | ||
| let outDir = ''; | ||
| let enabled = true; | ||
| let reportCompressed = false; | ||
| let enabled = options?.enabled ?? true; | ||
| let reportCompressed = true; | ||
| function truncatePath(filePath) { | ||
| let index = 0; | ||
| const normalizedPath = filePath.replaceAll('\u0000', ''); | ||
| if (normalizedPath.startsWith(outDir)) { | ||
| if (outDir && normalizedPath.startsWith(outDir)) { | ||
| index = outDir.length; | ||
| } | ||
| else if (normalizedPath.startsWith(root)) { | ||
| else if (root && normalizedPath.startsWith(root)) { | ||
| index = root.length; | ||
@@ -34,8 +34,11 @@ } | ||
| name: 'stats-plugin', | ||
| // vite specific hook | ||
| configResolved(config) { | ||
| root = config.root; | ||
| outDir = `${root}/${config.build.outDir}`; | ||
| // disable during dev mode | ||
| enabled = config.env.PROD; | ||
| reportCompressed = options?.reportCompressedSize ?? config.build.reportCompressedSize; | ||
| }, | ||
| outputOptions(opts) { | ||
| // workaround for libraries with multiple output formats | ||
| enabled = opts.format === 'es'; | ||
| }, | ||
| resolveId: { | ||
@@ -69,3 +72,2 @@ order: 'pre', | ||
| } | ||
| console.log(`Processing chunk "${chunk.fileName}"`); | ||
| const currentChunk = { | ||
@@ -72,0 +74,0 @@ fileName: chunk.fileName, |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
696963
02849
0.07%2
-33.33%