rexrainbow / phaser3-rex-notes

Notes of phaser3 engine
MIT License
1.2k stars 260 forks source link

Board example in Phaser TS project template #318

Closed rihards99 closed 1 year ago

rihards99 commented 1 year ago

When copying code from examples/board/touch-event-ts.ts into https://github.com/photonstorm/phaser3-typescript-project-template like in the example provided in https://rexrainbow.github.io/phaser3-rex-notes/docs/site/board-overview/#using-typescript-declaration-file the rollup script throws an error regarding eventemitter3

rollup v2.35.1
bundles ./src/game.ts → dist/game.js...
[!] Error: 'default' is not exported by node_modules/phaser3-rex-plugins/node_modules/eventemitter3/index.js, imported by node_modules/phaser3-rex-plugins/plugins/utils/eventemitter/EventEmitter.js
https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module
node_modules/phaser3-rex-plugins/plugins/utils/eventemitter/EventEmitter.js (1:7)
1: import EE from 'eventemitter3';
          ^
2:
3: class EventEmitter extends EE {
Error: 'default' is not exported by node_modules/phaser3-rex-plugins/node_modules/eventemitter3/index.js, imported by node_modules/phaser3-rex-plugins/plugins/utils/eventemitter/EventEmitter.js
rexrainbow commented 1 year ago

I use rollup to export minify files too. Here is my config file. You might try to add commonjs plugin to fix that error message.