phaser3-rex-notes
phaser3-rex-notes copied to clipboard
Circular import in TweakerShell
Thank you for this amazing UI plugin, this is the most extensive and well designed UI system I've come across for Phaser! ❤️
Issue
There is a circular import in TweakerShell.
node_modules/phaser3-rex-plugins/templates/ui/tweaker/TweakerShell.js
-> node_modules/phaser3-rex-plugins/templates/ui/tweaker/methods/Methods.js
-> node_modules/phaser3-rex-plugins/templates/ui/tweaker/methods/AddFolder.js
-> node_modules/phaser3-rex-plugins/templates/ui/tweaker/builders/CreateFolder.js
-> node_modules/phaser3-rex-plugins/templates/ui/tweaker/gameobjects/utils/CreateTweaker.js
-> node_modules/phaser3-rex-plugins/templates/ui/tweaker/TweakerShell.js
How to Reproduce
Using rollup, install the rexUI plugin and import into the config.ts file
import UIPlugin from 'phaser3-rex-plugins/templates/ui/ui-plugin.js';
const config = {
type: Phaser.AUTO,
width: 1080,
height: 1920,
resolution: window.devicePixelRatio,
scale: {
mode: Phaser.Scale.FIT,
autoCenter: Phaser.Scale.CENTER_HORIZONTALLY
},
scene: [DemoScene],
plugins: {
scene: [
{
key: 'rexUI',
plugin: UIPlugin,
mapping: 'rexUI'
}
]
}
};
During transpilation, Rollup will signal a circular import
I know this issue. Fortunately, the exporting of using rollup/webpack tool-chain is still working, so I choose ignoring this issue.