do-you-even-lift
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -5,3 +5,14 @@ # Change Log | ||
<a name="1.1.0"></a> | ||
# [1.1.0](https://github.com/npm/do-you-even-lift/compare/v1.0.0...v1.1.0) (2018-04-30) | ||
### Features | ||
* **bundle:** report which bundler succeeded ([5d5f94a](https://github.com/npm/do-you-even-lift/commit/5d5f94a)) | ||
* **error:** better reporting of fallthrough errors ([1df5dce](https://github.com/npm/do-you-even-lift/commit/1df5dce)) | ||
<a name="1.0.0"></a> | ||
# 1.0.0 (2018-04-26) |
36
index.js
@@ -38,2 +38,3 @@ 'use strict' | ||
const bundle = await bundlePackage(pkgDir) | ||
stats.bundler = bundle.bundler | ||
stats.bundleSize = Buffer.from(bundle.code, 'utf8').length | ||
@@ -70,3 +71,3 @@ const minifyResult = babel.transform(bundle.code, { | ||
try { | ||
return await (await rollup.rollup({ | ||
return Object.assign(await (await rollup.rollup({ | ||
input: entry, | ||
@@ -81,4 +82,6 @@ onwarn: () => {}, | ||
] | ||
})).generate({name: pkgJson.name, format: 'umd'}) | ||
} catch (err) { | ||
})).generate({name: pkgJson.name, format: 'umd'}), { | ||
bundler: 'rollup' | ||
}) | ||
} catch (rollupError) { | ||
const b = browserify(entry, { | ||
@@ -89,12 +92,23 @@ bare: true, | ||
}) | ||
return new Promise((resolve, reject) => { | ||
b.bundle((err, buf) => { | ||
if (err) { | ||
reject(err) | ||
} else { | ||
resolve({code: buf, map: ''}) | ||
try { | ||
return await new Promise((resolve, reject) => { | ||
b.bundle((err, buf) => { | ||
if (err) { | ||
reject(err) | ||
} else { | ||
resolve({code: buf, map: '', bundler: 'browserify'}) | ||
} | ||
}) | ||
}) | ||
} catch (browserifyError) { | ||
throw Object.assign( | ||
new Error( | ||
`Bundle could not be built. All bundlers failed.\nRollup Error: ${rollupError.message}\nBrowserify Error: ${browserifyError.message}` | ||
), { | ||
browserifyError, | ||
rollupError | ||
} | ||
}) | ||
}) | ||
) | ||
} | ||
} | ||
} |
{ | ||
"name": "do-you-even-lift", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Figure out an estimate of how heavy a particular npm package might be in various compression configurations", | ||
@@ -30,3 +30,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"babel-core": "^6.26.2", | ||
"babel-core": "^6.26.3", | ||
"babel-preset-minify": "^0.4.0", | ||
@@ -33,0 +33,0 @@ "browserify": "^16.2.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7171
102
Updatedbabel-core@^6.26.3