Skip to content

Commit

Permalink
Merge pull request #5 from blockchain-certificates/fix/ie-polymer-build
Browse files Browse the repository at this point in the history
fix(Build): ensure component runs on MS edge and IE11
  • Loading branch information
Julien Fraichot authored Sep 14, 2018
2 parents f8274b5 + 869e3ff commit f5ec2b5
Show file tree
Hide file tree
Showing 4 changed files with 6,194 additions and 6,254 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,27 @@ To use the component in your project, install it via:
npm i @blockcerts/blockcerts-verifier
```

Then just add it into your project with:
If your project **does not require support for IE11**, you can use the following build:

```html
<script type="module" src="node_modules/@blockcerts/blockcerts-verifier/dist/main.js"></script>
<script src="node_modules/@blockcerts/blockcerts-verifier/dist/main.js"></script>

<blockcerts-verifier></blockcerts-verifier>
```

You might need to add the webcomponent loader depending on the browsers you are targeting.
Chrome will support natively the code, but for Firefox, Safari, MS Edge (Opera and Brave), you will need to add the webcomponent loader before:

```html
<script src="node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
```

If your project **requires support for IE11**, you will need to use the ie11 build:
```html
<script src="node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js"></script>
<script src="node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script src="node_modules/@blockcerts/blockcerts-verifier/dist/ie11.js"></script>
```
Please note that because this is transpiled to ES5, the custom-elements-es5-adapter code is required for it to work properly in more modern browsers.

Have a look at the [Demo Pages](/demo) to see examples of the usage

## API Usage
Expand Down
Loading

0 comments on commit f5ec2b5

Please sign in to comment.