Skip to content

Commit d37719b

Browse files
Document how to configure ESM support (#328)
Co-authored-by: Daniel Lando <daniel.sorridi@gmail.com>
1 parent 2067ab0 commit d37719b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,18 @@ browsers:
414414
webgl.force-enabled: true
415415
```
416416

417+
## ESM Support
418+
419+
By default airtap doesn't support ESM, but you can configure it to work with ESM and CJS using the following config:
420+
```yml
421+
browserify:
422+
- transform: babelify
423+
global: true
424+
presets: ['@babel/preset-env']
425+
plugins: ['@babel/plugin-syntax-import-assertions']
426+
```
427+
You'll need to install `babelify`, `@babel/preset-env` and `@babel/plugin-syntax-import-assertions`. Note that other global browserify configs might break this and that the `global` parameter might not be required.
428+
417429
## Who Uses Airtap?
418430

419431
**Lots of folks!** Collectively, packages that depend on Airtap get 100's of millions of downloads per month!

0 commit comments

Comments
 (0)