davidfig / pixi-viewport

A highly configurable viewport/2D camera designed to work with pixi.js
https://davidfig.github.io/pixi-viewport/
MIT License
1.04k stars 174 forks source link

IE11 #173

Open mnovbaalen opened 4 years ago

mnovbaalen commented 4 years ago

I want to use pixi-viewport in a project that is being used by a significant share of internet explorer 11 users.

I can not manage to get pixi-viewport working in IE11. I use pixi.js-legacy 5.1.5, pixi-viewport 4.3.3 in a webpack / typescript setup. But I have also tried all sorts of other things like manually transpile via https://babeljs.io/ Whatever I try, the transpiled pixi-viewport code keeps having class definitions in it whch is not supported.

The examples also do not work in IE11: (https://davidfig.github.io/pixi-viewport/ and https://davidfig.github.io/pixi-viewport/builds/)

Does anyone know or have a working example for pixi-viewport in IE11?

davidfig commented 4 years ago

You need babel to compile your node_modules files. Here are some discussions:

https://stackoverflow.com/questions/54043498/how-to-transpile-node-modules-modules-with-babel-loader

https://stackoverflow.com/questions/51289261/babel-does-not-transpile-imported-modules-from-node-modules

mnovbaalen commented 4 years ago

Thank you for your quick response. I'm gonna give that a try and I will share my findings.

mnovbaalen commented 4 years ago

I'm very sorry for the late reply, but I can confirm that it is working now, using babel. This is the part of my webpack.config.js that handles .js files:

{ test: /\.js$/, exclude: /node_modules\/(?!(pixi-viewport)\/).*/, loader: 'babel-loader', },

c-andrews commented 4 years ago

Im currently having the same issue in my project. I'm using i've put the following in my tsconfig but i still keep getting a Syntax Error on the InputManager.

"exclude": [ "node_modules\/(?!(pixi-viewport)\/).*", "tests/**/*", "coverage/**/*", ]

Any help would be very appreciated