Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add standalone bundle for unpkg #4

Merged
merged 2 commits into from
Nov 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,17 @@ Test your web application with the [axe-core](https://github.com/dequelabs/axe-c

## Installation

You can install the module from NPM.

```sh
npm install --save-dev agnostic-axe
```
You can install the module from NPM via (`npm install --save-dev agnostic-axe`) or directly import it from the URL, as shown below:

## Usage

```js
import('agnostic-axe').then(({ AxeObserver, logViolations }) => {
const MyAxeObserver = new AxeObserver(logViolations)
MyAxeObserver.observe(document)
})
import('http://unpkg.com/agnostic-axe').then(
({ AxeObserver, logViolations }) => {
const MyAxeObserver = new AxeObserver(logViolations)
MyAxeObserver.observe(document)
}
)
```

> Be sure to only run the module in your development environment. Else your application will use more resources than necessary when in production.
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"name": "agnostic-axe",
"version": "1.0.0",
"version": "1.0.1",
"description": "Framework agnostic accessibility auditing with axe-core",
"main": "dist/index.js",
"umd:main": "dist/index.umd.js",
"module": "dist/index.mjs",
"unpkg": "dist/standalone.mjs",
"source": "index.js",
"scripts": {
"build": "npx microbundle",
"build": "npm run build:dependencies && npm run build:standalone",
"build:dependencies": "npx microbundle -f es,cjs",
"build:standalone": "npx microbundle --external none -f es -o dist/standalone.js",
"dev": "npx microbundle --watch",
"prepublishOnly": "npm run build",
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down