Skip to content

Commit a8db557

Browse files
authored
Merge pull request #30 from pastelsky/sk/ts-vue-svelte
Change default to named export
2 parents a023ec3 + f2be5e9 commit a8db557

File tree

6 files changed

+10
-7
lines changed

6 files changed

+10
-7
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
<img src="https://img.shields.io/npm/v/package-build-stats.svg" /> <img src="https://img.shields.io/npm/l/package-build-stats.svg" /> <img src="https://img.shields.io/github/workflow/status/pastelsky/package-build-stats/CI/master"/>
2-
1+
<img src="https://img.shields.io/npm/v/package-build-stats.svg" /> <img src="https://img.shields.io/npm/l/package-build-stats.svg" /> <img src="https://img.shields.io/github/workflow/status/pastelsky/package-build-stats/CI/master"/>
2+
33
This is the function that powers the core of building, minifying and gzipping of packages in bundlephobia.
44

55
## Usage
66

77
```js
8-
const getBuiltPackageStats = require('package-build-stats')
8+
const { getBuiltPackageStats } = require('package-build-stats')
99
```
1010

1111
#### Building packages from npm

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"scripts": {
2020
"start": "ts-node --files index.js",
2121
"dev": "DEBUG=bp* ts-node-dev --files index.js",
22+
"build": "tsc",
2223
"test": "jest",
2324
"test:ci": "yarn test --colors",
2425
"prettier": "prettier --write '**/*.{html,js,ts,json,css,scss,jsx,flow,md,yml,yaml}'",

src/common.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export type GetPackageStatsOptions = Pick<
3737
| 'networkConcurrency'
3838
| 'debug'
3939
| 'customImports'
40-
>
40+
>
4141

4242
export type Externals = {
4343
externalPackages: Array<string>

src/errors/CustomError.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ export class PackageNotFoundError extends CustomError {
4343
}
4444
}
4545

46-
4746
export class CLIBuildError extends CustomError {
4847
constructor(originalError: any, extra?: any) {
4948
super('CLIBuildError', originalError, extra)

src/getPackageExportSizes.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ export async function getAllPackageExports(
3636
}
3737
}
3838

39-
export async function getPackageExportSizes(packageString: string, options = {}) {
39+
export async function getPackageExportSizes(
40+
packageString: string,
41+
options = {}
42+
) {
4043
const { name: packageName, normalPath } = parsePackageString(packageString)
4144
const installPath = await InstallationUtils.preparePath(packageName)
4245

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export { default } from './getPackageStats'
1+
import { default as getPackageStats } from './getPackageStats'
22
export * from './errors/CustomError'
33
export { default as getParseTime } from './getParseTime'
44
export * from './getPackageExportSizes'

0 commit comments

Comments
 (0)