perf-marks
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -10,2 +10,8 @@ # Change Log | ||
## [1.4.1][] - 2019-10-26 | ||
### Updated | ||
- Adding docs for bundle optimization and how to use different bundles in web apps | ||
## [1.4.0][] - 2019-10-26 | ||
@@ -123,5 +129,7 @@ | ||
[1.3.1]: https://github.com/willmendesneto/perf-marks/tree/v1.3.1 | ||
[unreleased]: https://github.com/willmendesneto/perf-marks/compare/v1.4.0...HEAD | ||
[1.4.0]: https://github.com/willmendesneto/perf-marks/tree/v1.4.0 | ||
[Unreleased]: https://github.com/willmendesneto/perf-marks/compare/v1.4.0...HEAD | ||
[1.4.0]: https://github.com/willmendesneto/perf-marks/tree/v1.4.0 | ||
[Unreleased]: https://github.com/willmendesneto/perf-marks/compare/v1.4.1...HEAD | ||
[1.4.1]: https://github.com/willmendesneto/perf-marks/tree/v1.4.1 |
{ | ||
"name": "perf-marks", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"author": "Will Mendes <willmendesneto@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "The simplest and lightweight solution for User Timing API in Javascript.", |
@@ -206,2 +206,63 @@ # Perf-marks | ||
If you need optimize your bundle size even more, this package provides different bundles for `CommonJS`, `UMD`, `ESM` and `ES2015`. To make the dev experience smoothiest as possible, you can use `babel-plugin-transform-imports` in your app and configure the bundle that fits the most for your app! | ||
```bash | ||
yarn add -D babel-plugin-transform-imports | ||
# or | ||
npm install --save-dev babel-plugin-transform-imports | ||
``` | ||
Create a `.babelrc.js` file in the root directory of your project: | ||
```js | ||
const plugins = [ | ||
[ | ||
'babel-plugin-transform-imports', | ||
{ | ||
'perf-marks/perf-marks': { | ||
// Use "transform: 'perf-marks/perf-marks/${member}'," if your bundler does not support ES modules | ||
transform: 'perf-marks/dist/esm/${member}', | ||
preventFullImport: true, | ||
}, | ||
'perf-marks/entries': { | ||
// Use "transform: 'perf-marks/entries/${member}'," if your bundler does not support ES modules | ||
transform: 'perf-marks/entries/esm/${member}', | ||
preventFullImport: true, | ||
}, | ||
}, | ||
], | ||
]; | ||
module.exports = { plugins }; | ||
``` | ||
Or just use it via `babel-plugin-import` | ||
```bash | ||
yarn add -D babel-plugin-import | ||
# or | ||
npm install --save-dev babel-plugin-import | ||
``` | ||
Create a `.babelrc.js` file in the root directory of your project: | ||
```js | ||
const plugins = [ | ||
[ | ||
'babel-plugin-import', | ||
{ | ||
libraryName: 'perf-marks/entries', | ||
// Use "'libraryDirectory': ''," if your bundler does not support ES modules | ||
libraryDirectory: 'esm', | ||
camel2DashComponentName: false, | ||
}, | ||
'entries', | ||
], | ||
]; | ||
module.exports = { plugins }; | ||
``` | ||
And enjoy! Yeah, it's simple like that 😉 | ||
## Publish | ||
@@ -208,0 +269,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
53350
279