Skip to content

Commit

Permalink
ESM + fixed build
Browse files Browse the repository at this point in the history
- updated dependencies
- migrated the whole package from CommonJS to ESM
- fixed dev/prod build and added embed client to the outputs
  • Loading branch information
tg666 committed Dec 8, 2023
1 parent ab9611e commit 32fb902
Show file tree
Hide file tree
Showing 71 changed files with 2,100 additions and 2,029 deletions.
3 changes: 1 addition & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"env": {
"node": false,
"es6": true,
"browser": true,
"commonjs": true
"browser": true
},
"extends": "eslint:recommended",
"overrides": [],
Expand Down
1 change: 1 addition & 0 deletions demo/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
amp-client.js
amp-client.embed.js
18 changes: 13 additions & 5 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@
<div class="container">
<h1>Banners:</h1>
<div>
<h2>First (added manually, single):</h2>
<h2>Manually added single banner:</h2>
<div id="banner1" class="wrapper"></div>
<script>
AMPClient.createBanner('#banner1', 'homepage.center_left');
</script>
</div>
<div>
<h2>Second (added manually, random):</h2>
<h2>Manually added random banner:</h2>
<div id="banner2" class="wrapper"></div>
<script>
AMPClient.createBanner(document.getElementById('banner2'), 'homepage.info_box_1', {
Expand All @@ -114,14 +114,22 @@ <h2>Second (added manually, random):</h2>
</script>
</div>
<div>
<h2>Third (added via data-* attributes, multiple):</h2>
<h2>Multiple banner added via data attributes:</h2>
<div data-amp-banner="homepage.top"
data-amp-resource-roles="employee, vip"
data-amp-resource-apple_products="shop/buy-iphone/iphone-xs"
data-amp-option-loading="lazy"
data-amp-option-loading-offset="1"
class="slider--splide"
></div>
class="slider--splide">
</div>
</div>

<div>
<h2>Embed banner:</h2>
<div data-amp-banner="homepage.center_right"
data-amp-mode="embed"
data-amp-option-loading="lazy">
</div>
</div>
</div>

Expand Down
8 changes: 0 additions & 8 deletions index.js

This file was deleted.

3 changes: 3 additions & 0 deletions index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { ClientFactory as default } from './src/client/standard/client-factory.mjs';
export { ClientFactory as AMPClientFactory } from './src/client/standard/client-factory.mjs';
export { ClientFactory as EmbedAMPClientFactory } from './src/client/embed/client-factory.mjs';
Loading

0 comments on commit 32fb902

Please sign in to comment.