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

Fix exports #713

Merged
merged 2 commits into from
Jun 17, 2024
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
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ If you are working with a browser, be aware this is an ES6 module:

```html
<script type="module">
import ICAL from "https://unpkg.com/ical.js";
import ICAL from "https://unpkg.com/ical.js/dist/ical.min.js";
document.querySelector("button").addEventListener("click", () => {
ICAL.parse(document.getElementById("txt").value);
});
Expand All @@ -51,11 +51,17 @@ If you are working with a browser, be aware this is an ES6 module:

If you need to make use of a script tag, you can use the transpiled ES5 version:
```html
<script src="https://unpkg.com/ical.js/dist/ical.es5.cjs"></script>
<script src="https://unpkg.com/ical.js/dist/ical.es5.min.cjs"></script>
<textarea id="txt"></textarea>
<button onclick="ICAL.parse(document.getElementById('txt').value)"></button>
```

The browser examples above use the minified versions of the library, which is probably what you want.
However, there are also unminified versions of ICAL.js available on unpkg.

- Unminified ES6 module: `https://unpkg.com/ical.js/dist/ical.js`
- Unminified ES5 version: `https://unpkg.com/ical.js/dist/ical.es5.cjs`

## Timezones
The stock ical.js does not register any timezones, due to the additional size it brings. If you'd
like to do timezone conversion, and the timezone definitions are not included in the respective ics
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
"ghpages": "npm run jsdoc && npm run validator && npm run recurtester"
},
"exports": {
"import": "./dist/ical.min.js",
"require": "./dist/ical.es5.min.cjs"
"import": "./dist/ical.js",
"require": "./dist/ical.es5.cjs"
},
"files": [
"dist/ical.js",
Expand Down