lean / phaser-es6-webpack

A bootstrap project for create games with Phaser + ES6 + Webpack.
MIT License
1.28k stars 314 forks source link

Games don't play audio in production #23

Closed crazyyi closed 7 years ago

crazyyi commented 7 years ago

I have an "audio" folder in "assets" folder. My audio files reside in that folder and my game references audio files in the folder. When I run "dev" my game plays background music but when I run "deploy" and click the index.html file my game has no sound. How should I configure webpack to play the background music in production? Or do I need to change any directory structure?

microcipcip commented 7 years ago

You're probably opening the index.html file directly, you should use a proper server like MAMP or XAMP so that when you open your file in the url bar you see something like http://localhost/my-project instead of file:///C:/Users/MyUserName/Desktop/index.html

lean commented 7 years ago

Anyway this is not a bug, this is not concerned with the project. Maybe you could find a proper solution with the webpack community.