@simplewebauthn/browser
Advanced tools
Comparing version 3.0.0 to 3.1.0
{ | ||
"name": "@simplewebauthn/browser", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "SimpleWebAuthn for Browsers", | ||
"main": "dist/es5/index.js", | ||
"main:es2018": "dist/es2018/index.js", | ||
"main": "dist/bundle/index.js", | ||
"unpkg": "dist/bundle/index.umd.min.js", | ||
"types": "dist/types/index.d.ts", | ||
@@ -32,15 +32,11 @@ "author": "Matthew Miller <matthew@millerti.me>", | ||
], | ||
"peerDependencies": { | ||
"tslib": "^2.2.0" | ||
}, | ||
"devDependencies": { | ||
"@rollup/plugin-node-resolve": "^11.2.1", | ||
"@rollup/plugin-node-resolve": "^13.0.0", | ||
"@rollup/plugin-typescript": "^8.2.1", | ||
"@simplewebauthn/typescript-types": "^3.0.0", | ||
"rollup": "^2.44.0", | ||
"rollup": "^2.52.1", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"rollup-plugin-version-injector": "^1.3.3", | ||
"tslib": "^2.2.0" | ||
"rollup-plugin-version-injector": "^1.3.3" | ||
}, | ||
"gitHead": "8324f1fff96fb08422e609aa91a646dc2b08d184" | ||
"gitHead": "d421a7c73c25eced6bc4a397d5571156d00b5092" | ||
} |
@@ -15,7 +15,2 @@ <!-- omit in toc --> | ||
- [Usage](#usage) | ||
- [Building for Production](#building-for-production) | ||
- [ES5](#es5-1) | ||
- [ES2018](#es2018-1) | ||
- [Webpack support](#webpack-support) | ||
- [Rollup support](#rollup-support) | ||
@@ -42,3 +37,3 @@ ## Installation | ||
<script src="https://unpkg.com/@simplewebauthn/browser/dist/es5/index.umd.min.js"></script> | ||
<script src="https://unpkg.com/@simplewebauthn/browser/dist/bundle/index.es5.umd.min.js"></script> | ||
``` | ||
@@ -52,3 +47,3 @@ | ||
<script src="https://unpkg.com/@simplewebauthn/browser/dist/es2018/index.umd.min.js"></script> | ||
<script src="https://unpkg.com/@simplewebauthn/browser"></script> | ||
``` | ||
@@ -59,61 +54,1 @@ | ||
You can find in-depth documentation on this package here: https://simplewebauthn.dev/docs/packages/browser | ||
## Building for Production | ||
Two unbundled versions of this library are offered for your convenience, one targeting `ES5` and a second targeting `ES2018`. | ||
### ES5 | ||
The `ES5` version is suitable for use when **deprecated browsers** like IE10+ or Edge Legacy need to be supported. This version is also the **default** version that gets pulled in as the `"main"` entry in **package.json**. | ||
TypeScript and JavaScript codebases alike can import and use this library without any special build configuration considerations. | ||
However, you will need to ensure that the `tslib` dependency gets pulled into your build artifact: | ||
- If you are authoring your application in TypeScript then this package will be **automatically** included so long as your **tsconfig.json** sets `"target": "ES5"`. | ||
- If your application is written in Javascript then you will need to install this package **manually** by adding it to `dependencies` in your project's **package. json**: | ||
```sh | ||
$> npm install tslib | ||
``` | ||
### ES2018 | ||
The `ES2018` version is suitable for use when only **modern browsers** need to be supported. TypeScript and JavaScript codebases alike can import and use this library. However, you will need to ensure that your bundler pulls in the ES2018 version of the library when building your application! | ||
See bundler instructions below. | ||
#### Webpack support | ||
No matter the `"target"` of your build you'll need to indicate additional files for webpack to resolve via the [`"resolve.mainFields"`](https://webpack.js.org/configuration/resolve/#resolvemainfields) property in your config. Resolve the `"main:es2018"` field defined in **package.json**: | ||
```js | ||
module.exports = { | ||
//... | ||
resolve: { | ||
mainFields: [ 'main:es2018', 'module', 'main' ], | ||
}, | ||
}; | ||
``` | ||
`'main:es2018'` must come first in the list to ensure that the `ES2018` version of this library is bundled. Additional values can be added afterwards as needed. | ||
#### Rollup support | ||
Add the [`@rollup/plugin-node-resolve`](https://github.com/rollup/rollup-plugin-node-resolve#usage) plugin to your Rollup config to read in the `"main:es2018"` field from **package.json**: | ||
```js | ||
// rollup.config.js | ||
import resolve from 'rollup-plugin-node-resolve'; | ||
export default { | ||
// input: ... | ||
// output: ... | ||
plugins: [ | ||
//... | ||
resolve({ mainFields: [ 'main:es2018', 'module', 'main' ] }), | ||
] | ||
} | ||
``` | ||
`'main:es2018'` must come first in the list to ensure that the `ES2018` version of this library is bundled. Additional values can be added afterwards as needed. |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
0
6
17457
16
179
51
1