-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from yousifalraheem/develop
Improvements 29-Mar-2021
- Loading branch information
Showing
16 changed files
with
3,133 additions
and
2,489 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<hr/> | ||
|
||
## Options | ||
|
||
These are the available options: | ||
|
||
| Name | Type | Description | Default | | ||
| --------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | | ||
| warnLow | number | Minimum size in bytes to be highlighted in yellow.<br><sub>This is used to warn <span style="color: #ffcd39;">(in yellow)</span> about the files whom on the brink of exceeding the acceptable pre-defined file size</sub> | 5000 | | ||
| warnHigh | number | Minimum size in bytes to be highlighted in red.<br><sub>This is used to alert <span style="color: #dc3545;">(in red)</span> about files that exceeded the acceptable pre-defined file size</sub> | 10000 | | ||
| totalLow | number | Minimum total size in bytes to be highlighted in yellow.<br><sub>This is used to warn <span style="color: #ffcd39;">(in yellow)</span> about the total build size if it comes nearly below maximum acceptable pre-defined size</sub> | 200000 | | ||
| totalHigh | number | Minimum total size in bytes to be highlighted in red.<br><sub>This is used to alert <span style="color: #dc3545;">(in red)</span> about the total build size if it exceeds the acceptable pre-defined size</sub> | 300000 | | ||
|
||
<br/> | ||
|
||
Here is an example of how it's used: | ||
|
||
```javascript | ||
{ | ||
plugins: [ | ||
summary({ | ||
warnLow: 1000, | ||
warnHigh: 3000, | ||
showMinifiedSize: false | ||
}) | ||
] | ||
} | ||
``` | ||
|
||
<br/> | ||
|
||
<small>**Note:** When changing the aforementioned options make sure you pass them in pairs. Changing the `warnLow` will require you to also pass `warnHigh`. Same goes with `totalLow` and `totalHigh`. The reason is if you don't change the `high` value, it will will be prioritized. So raising the `warnLow` value will still result in the value to be highlighted in `red`.</small> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,59 @@ | ||
declare module "rollup-plugin-summary" { | ||
export interface SummaryOptions { | ||
/** Minimum size in bytes to be highlighted in yellow. Default: `5000` */ | ||
warnLow: number; | ||
/** Minimum size in bytes to be highlighted in red. Default: `10000` */ | ||
warnHigh: number; | ||
/** Minimum total size in bytes to be highlighted in yellow. Default: `200000` */ | ||
totalLow: number; | ||
/** Minimum total size in bytes to be highlighted in red. Default: `300000` */ | ||
totalHigh: number; | ||
} | ||
declare interface SummaryPrint { | ||
Name: string; | ||
Size: string; | ||
Minified: string; | ||
Gzipped: string; | ||
Brotli: string; | ||
} | ||
|
||
declare interface SummaryOptions { | ||
/** | ||
* Minimum size in bytes to be highlighted in yellow. | ||
* @default 5000 | ||
* @description | ||
* This is used to warn (in yellow) about the files whom on the brink of exceeding the acceptable pre-defined file size | ||
*/ | ||
warnLow?: number; | ||
/** | ||
* Minimum size in bytes to be highlighted in red. | ||
* @default 10000 | ||
* @description | ||
* This is used to alert (in red) about files that exceeded the acceptable pre-defined file size | ||
*/ | ||
warnHigh?: number; | ||
/** | ||
* Minimum total size in bytes to be highlighted in yellow. | ||
* @default 200000 | ||
* @description | ||
* This is used to warn (in yellow) about the total build size if it comes nearly below maximum acceptable pre-defined size | ||
*/ | ||
totalLow?: number; | ||
/** | ||
* Prints out a summary of the rollup build | ||
* @param {SummaryOptions} options Summary plugin options | ||
* Minimum total size in bytes to be highlighted in red. | ||
* @default 300000 | ||
* @description | ||
* This is used to alert (in red) about the total build size if it exceeds the acceptable pre-defined size | ||
*/ | ||
export default function summary(options: SummaryOptions): void; | ||
totalHigh?: number; | ||
/** | ||
* Show file size in Brotli compression. | ||
* @default true | ||
*/ | ||
showBrotliSize?: boolean; | ||
/** | ||
* Show file size minified. | ||
* @default true | ||
*/ | ||
showMinifiedSize?: boolean; | ||
/** | ||
* Show file size Gzipped. | ||
* @default true | ||
*/ | ||
showGzippedSize?: boolean; | ||
} | ||
|
||
/** | ||
* Prints out a summary of the rollup build | ||
* @param {SummaryOptions} options Summary plugin options | ||
*/ | ||
export default function summary(options: SummaryOptions): void; |
Oops, something went wrong.