0.12.1 • Published 9 months ago

vite-bundle-analyzer v0.12.1

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

!WARNING Vite's enable minify by default.There for you will see that the parsed size is larger than actual size.This is because the bundle info provide by rollup isn't compressed.(If you care about this problem you can choose anothr plugins.)

analyzer

Install

$ yarn add vite-bundle-analyzer -D

# or

$ npm install vite-bundle-analyzer -D

Usage

import { defineConfig } from 'vite'

import { analyzer } from 'vite-bundle-analyzer'

export default defineConfig({
  plugins: [
    // ...your plugin
    analyzer()
  ]
})

// If you are using it in rollup or others support rollup plugin system you can import 'adapter' from package.
// Then use it with adapter(analyzer())

Options

paramstypedefaultdescription
analyzerModeserver\|static\|jsonserverIn server will create a static server to preview.
fileNamestringstatsThe name of the static product.(No suffix name)
reportTitlestringplugin nameReport website title.
gzipOptionsRecord<string,any>{}Compression options. (Details see zlib module)
analyzerPortnumber\|'auto'8888static server port.
openAnalyzerbooleantrueOpen the static website. (Only works on analyzerMode is server or static )
defaultSizesstat\|parsed\|gzipstatThe default type selected in the client page
summarybooleantrueShow full chunk info to stdout.

Sponsors

Contributions

Contributions are welcome! If you find a bug or want to add a new feature, please open an issue or submit a pull request.

Author and contributors

DEBUG

If you're using vite you can get the logs with vite build --debug and then extreact the part relevant to analyze plugin. Or using cross-env to setup ANALYZE_DEBUG=true in your local. env.

Why i get the chunk size is empty?

If you're use a plugin that break the sourcemap it will affect the analyze plugin. I know it's stupid, But is the way to get the size close to the actual size. Like @vitejs/plugin-legacy don't prvide the correctly sourcemap for legacy chunk. For some reason, no analysis will be provided for those module.

Why when i specify analyzerMode as static and set openAnalyzer as false don't create a liviing server?

I don't want to add new option to control living server.

LICENSE

MIT

0.11.0

9 months ago

0.12.0

9 months ago

0.11.1

9 months ago

0.12.1

9 months ago

0.10.1

1 year ago

0.10.2

1 year ago

0.10.3

1 year ago

0.10.4

11 months ago

0.10.5

11 months ago

0.10.6

10 months ago

0.10.0

1 year ago

0.9.4

1 year ago

0.9.3

1 year ago

0.9.2

1 year ago

0.9.1

1 year ago

0.9.0

1 year ago

0.8.3

1 year ago

0.8.2

1 year ago

0.8.1

1 year ago

0.8.0

1 year ago

0.7.0

1 year ago

0.6.1

1 year ago

0.6.0

1 year ago

0.5.0

2 years ago

0.4.0

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago

0.0.1

2 years ago