ige
ige copied to clipboard
IGE-ES6 - Using the engine as a module\project reference is broken by recent change
This change below has resulted in a subtle difference in the generated .js file for the index of the module. This wouldn't be apparent unless you are referencing IGE as a module or via a typescript project reference (I am doing the latter).
https://github.com/Irrelon/ige/blob/6d0b289a154832dde9b7c0fcf989caa9ea24cbd6/index.ts#L3
It seems to be that the compiler is having difficulty following the custom paths starting with '@' when processing an export directive. I tried to work around it by replacing import { ige } from "@irrelon/ige";
with import { ige } from "@/engine/instance.js";
but there's a further snafu which means that if there are no imports of the index.ts file then you don't pull in the ige-specific extensions to the Event type defined there, which breaks compilation as well.
@Irrelon Could this change be rolled back?
Use npm run fixPaths
:)
Thanks for the suggestion! Unfortunately it had no effect on the contents of index.js
This change below has resulted in a subtle difference in the generated .js file for the index of the module. This wouldn't be apparent unless you are referencing IGE as a module or via a typescript project reference (I am doing the latter).
https://github.com/Irrelon/ige/blob/6d0b289a154832dde9b7c0fcf989caa9ea24cbd6/index.ts#L3
It seems to be that the compiler is having difficulty following the custom paths starting with '@' when processing an export directive. I tried to work around it by replacing
import { ige } from "@irrelon/ige";
withimport { ige } from "@/engine/instance.js";
but there's a further snafu which means that if there are no imports of the index.ts file then you don't pull in the ige-specific extensions to the Event type defined there, which breaks compilation as well.@Irrelon Could this change be rolled back?
Hey ya! Are you consuming the engine via its compiled js files or directly via the ts files?
The /index.js file should have the contents:
export * from "engine/instance";
So the custom TypeScript paths shouldn't interfere. If you are using the engine via TS directly, it's not a setup I've tried, could you throw together a barebones example project of how you're doing it so I can debug from my end? A github project I can clone would be great.
Hi mate, sorry for the delay I've been on holiday for a couple of weeks back in England. Will try to put something together for you asap.