howler.js icon indicating copy to clipboard operation
howler.js copied to clipboard

Usage with webpack

Open sibelius opened this issue 10 years ago • 3 comments

How can I use it with webpack?

sibelius avatar Aug 23 '16 21:08 sibelius

You can load your sounds using file-loader (url-loader might work, but I haven't tried). Just pass the result of your require as the src option (like this: new Howl({src: [require("./my-sound.mp3")]})).

FullR avatar Aug 25 '16 18:08 FullR

I add something like this:

import Howler from 'howler';
const { Howl } = Howler;

and it did work, tks

sibelius avatar Aug 25 '16 19:08 sibelius

You can also just do:

import { Howl } from 'howler';

cjke avatar Jan 02 '17 15:01 cjke