lean / phaser-es6-webpack

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

deploy creates wrong file paths #59

Closed eladonline closed 6 years ago

eladonline commented 6 years ago

When I'm running the game in dev mode everything works fine But after deployment, I enter build directory and run the index file. And getting errors of files not found . It seems that the 'deploy' doesn't arrange the paths right .

Wrong path
image

Right path! image

This is the main directory path:

C:\Users\admin\Desktop\zelda diamond collector\phaser-es6-webpack

Here is the hierarchy: image

eladonline commented 6 years ago

I manage to overcome the problem, but the issue should still be fixed. The file that imported the assets, had the path "../../assets/etc..." which works fine in dev env . Now, the vendor.bundle sits in "root/js", and opening it from index file will try to go to "not exist/not exist/root" I solved it by changing "../../assets/etc..." to "./assets/etc..." but I guess it isn't a good behavior

lean commented 6 years ago

Thanks @eladonline. This is not a good behavior. I will see it

lean commented 6 years ago

@eladonline seems like you are not using a web server. Your paths does not be "file://". Please, try to serve your files with Browsersyc. Run inside the build folder: browser-sync start --server