GoogleChrome / omnitone

Spatial Audio Rendering on the web.
https://googlechrome.github.io/omnitone
Apache License 2.0
852 stars 114 forks source link

Using NPM-installed version with bundler #105

Open bradisbell opened 4 years ago

bradisbell commented 4 years ago

After running npm install omnitone, I'm trying the following in my code:

const Omnitone = require('omnitone');

This results in an empty object. I see on the browser's console the Omnitone version statement logged, so I know the library is getting bundled and ran.

Any advice on how to properly require() this library? I'm using Browserify for bundling.

0xpolarzero commented 2 years ago

If anyone is checking this to get an answer, it worked for me using this path instead :

import { default as Omnitone } from 'omnitone/build/omnitone.esm';