-
Hello. I tried to make excalibur.js work with rollup.js. I ran into this problem:
Can someone help? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 7 replies
-
So I tinkered around a bit. I changed the import from:
to:
This resulted in some problems: First, it required Second, it required Third, this error:
"Circular dependencies" is a rollup problem. They are AFAIK not off standard and it should not be a problem. " Also, I get this runtime error:
|
Beta Was this translation helpful? Give feedback.
-
Next step: I managed to handle the commonjs modules by adding the Line 5 in a7d3015 I think it is wrong that this untransfromed line is in the packaged version of excalibur.js. |
Beta Was this translation helpful? Give feedback.
-
@mogoh I'm looking into this, I do want to put up a rollup template, however I'm currently struggling to configure rollup properly for a small example. Perhaps a "bad" way to get things working is to use excalibur as an external like we did here (albeit a long while ago) you'll lose tree shaking unfortunately Currently we have templates in webpack/parcel that work pretty well in the current state if you need to get something up and running fast with the desired |
Beta Was this translation helpful? Give feedback.
-
@mogoh I pushed up a sub-optimal template https://github.com/excaliburjs/template-ts-rollup, it will be slightly better than this approach because we can control the version of excalibur via npm, but it still brings the entire excalibur source into the bundle. Excalibur's modules in the current state aren't ideal for rollup to consume. Our upcoming release will switch excalibur to es2015 modules and we can also make use of the package module property to improve this rollup experience https://github.com/rollup/rollup/wiki/pkg.module |
Beta Was this translation helpful? Give feedback.
-
Thank you for your in-depth response. For me, there was only one thing missing.
to:
|
Beta Was this translation helpful? Give feedback.
@mogoh I pushed up a sub-optimal template https://github.com/excaliburjs/template-ts-rollup, it will be slightly better than this approach because we can control the version of excalibur via npm, but it still brings the entire excalibur source into the bundle. Excalibur's modules in the current state aren't ideal for rollup to consume.
Our upcoming release will switch excalibur to es2015 modules and we can also make use of the package module property to improve this rollup experience https://github.com/rollup/rollup/wiki/pkg.module