Skip to content

Commit

Permalink
Docs: Link CJS and ESM examples to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
literat committed Dec 6, 2021
1 parent 22ee445 commit 0c2f377
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ via npm package [@lmc-eu/cookie-consent-manager](https://www.npmjs.com/package/@
See below for [configuration options](#configuration).
You can also look at the [example with EcmaScript module syntax][examples-integration-esm].
3. Include default CSS in your HTML:
```html
<link rel="stylesheet" href="node_modules/@lmc-eu/cookie-consent-manager/LmcCookieConsentManager.min.css">
Expand Down Expand Up @@ -131,6 +133,8 @@ You can also use module with CommonJS import syntax:
const LmcCookieConsentManager = require('@lmc-eu/cookie-consent-manager');
```
You can also look at the [example with CommonJS syntax][examples-integration-cjs].
Note: We prefer to use modern ESM import syntax so this is marked as legacy.
*With Webpack:* Webpack prioritises the ESM import syntax over CommonJS import syntax. So resolve the `main` field as first: `resolve: { mainFields: ["main", /* ... */ ] },`
Expand Down Expand Up @@ -458,3 +462,5 @@ for more information.
[examples-callbacks]: https://lmc-eu.github.io/cookie-consent-manager/examples/callbacks.html
[examples-configuration]: https://lmc-eu.github.io/cookie-consent-manager/examples/configuration.html
[examples-theming]: https://lmc-eu.github.io/cookie-consent-manager/examples/theming.html
[examples-integration-esm]: https://github.com/lmc-eu/cookie-consent-manager/tree/main/examples/webpack-with-esm/
[examples-integration-cjs]: https://github.com/lmc-eu/cookie-consent-manager/tree/main/examples/webpack-with-cjs/

0 comments on commit 0c2f377

Please sign in to comment.