nuxt-bundle-analysis
Advanced tools
Comparing version 0.0.8 to 1.0.0
{ | ||
"name": "nuxt-bundle-analysis", | ||
"version": "0.0.8", | ||
"version": "1.0.0", | ||
"description": "Analyzes each PR's impact on your nuxt.js app's bundle size and displays it using a comment.", | ||
@@ -19,3 +19,3 @@ "main": "index.js", | ||
"minor": "npm version minor", | ||
"build": "tsc --project src/ts/tsconfig.json" | ||
"build": "tsc --project src/tsconfig.json" | ||
}, | ||
@@ -22,0 +22,0 @@ "repository": { |
@@ -7,10 +7,13 @@ # Nuxt.js Bundle Analysis Scripts | ||
> ⚠️ It is not an npm package, so please copy it to your own project. | ||
![image](https://user-images.githubusercontent.com/43837308/159209639-518f7136-e471-41d0-8305-a67265432082.png) | ||
## Installation | ||
## Usage | ||
1. Run the following command. The command will create a `.github/workflows` directory in your project root and add a `nuxt_bundle_analysis.yml` file to it - that's all it takes! | ||
1. Setting nuxt.config.js and Build. | ||
```bash | ||
npx -p nuxt-bundle-analysis generate | ||
``` | ||
2. Setting nuxt.config.js and Build. | ||
Set nuxt.config.js as follows so that bundle statistics are output. | ||
@@ -31,6 +34,7 @@ After configuration and build, `.nuxt/stats.client.json` will be output. | ||
2. Setting package.json | ||
This script uses the settings described in package.json. `nuxtBundleAnalysis` | ||
See [here](#Options) for options. | ||
## Configuration | ||
This script uses the settings described in package.json. `nuxtBundleAnalysis` | ||
See [here](#Options) for options. | ||
```json:package.json | ||
@@ -43,10 +47,9 @@ "devDependencies": {}, | ||
3. Run `report.js` or `report.ts` | ||
`report.js` or `report.ts` calculates bundle size based on ` statsFile` and outputs data for comparison.(`analyze/__bundle_analysis.json` is generated.) | ||
## Description of each script | ||
4. Create `__bundle_analysis.json` as a basis for comparison. | ||
Create `__bundle.analysis.json` in `analyze/base/bundle` for comparison. | ||
- `report.ts` | ||
`report.ts` calculates bundle size based on ` statsFile` and outputs data for comparison.(`analyze/__bundle_analysis.json` is generated.) | ||
5. Run `compare.js` or `compare.ts` | ||
`compare.js` or `compare.ts` compares `analyze/base/bundle/__bundle_analysis.json` and `analyze/__bundle_analysis.json` and generates a text file containing the difference in bundle size The following is an example of the process.(`analyze/__bundle_analysis_comment.txt` is generated.) | ||
- `compare.ts` | ||
`compare.ts` compares `analyze/base/bundle/__bundle_analysis.json` and `analyze/__bundle_analysis.json` and generates a text file containing the difference in bundle size The following is an example of the process.(`analyze/__bundle_analysis_comment.txt` is generated.) | ||
@@ -53,0 +56,0 @@ ## Options |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
63
17943