깃헙 템플릿을 참고했다. https://github.com/photonstorm/phaser3-project-template
컴파일 ****타임에 전역 상수를 선언
new webpack.DefinePlugin({
CANVAS_RENDERER: JSON.stringify(true),
WEBGL_RENDERER: JSON.stringify(true)
}),
raw-loader 사용
file-loader를 통해서 이미지 파일을 가져 옴
import Phaser from "phaser";
new Phaser.Game({
type: Phaser.AUTO,
parent: "phaser-example",
width: 800,
height: 600,
scene: {
preload: () => {},
create: () => {},
update: () => {},
},
});
Phaser.AUTO
WEBGL
지원해주지 않으면 CANVAS
모드로 돌아가게 된다.