Skip to content

Commit

Permalink
fix: add legacy main resolver for CDN/Webpack4 (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyJasonBennett authored Aug 18, 2023
1 parent 6a32397 commit 744ddb9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Size](https://img.shields.io/bundlephobia/minzip/fourwastaken?label=gzip&style=flat&colorA=000000&colorB=000000)](https://bundlephobia.com/package/fourwastaken)
[![Size](https://img.shields.io/badge/dynamic/json?label=gzip&style=flat&colorA=000000&colorB=000000&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=fourwastaken)](https://unpkg.com/fourwastaken)
[![Version](https://img.shields.io/npm/v/fourwastaken?style=flat&colorA=000000&colorB=000000)](https://npmjs.com/package/fourwastaken)
[![Downloads](https://img.shields.io/npm/dt/fourwastaken.svg?style=flat&colorA=000000&colorB=000000)](https://npmjs.com/package/fourwastaken)

Expand Down Expand Up @@ -33,18 +33,18 @@ Minimal three.js alternative.

## Installation

To install, use your preferred package manager:
To install, use your preferred package manager or CDN:

```bash
npm install four@npm:fourwastaken
yarn add four@npm:fourwastaken
pnpm add four@npm:fourwastaken
```

This will install `fourwastaken` as `four`; both will be available.

```ts
import * as FOUR from 'four'
```html
<script type="module">
import * as FOUR from 'https://unpkg.com/fourwastaken'
</script>
```

> **Note**: Vite may have issues consuming WebGPU code which relies on top-level await via ESM. This is well supported since 2021, but you may need to use [vite-plugin-top-level-await](https://github.com/Menci/vite-plugin-top-level-await) to use this library with `vite.optimizeDeps`.
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"src/*"
],
"type": "module",
"main": "./dist/index.js",
"exports": "./dist/index.js",
"sideEffects": false,
"devDependencies": {
Expand Down

0 comments on commit 744ddb9

Please sign in to comment.