rexrainbow / phaser3-rex-notes

Notes of phaser3 engine
MIT License
1.22k stars 263 forks source link

Circular import in TweakerShell #372

Closed rui-han-crh closed 8 months ago

rui-han-crh commented 1 year ago

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 image

rexrainbow commented 1 year ago

I know this issue. Fortunately, the exporting of using rollup/webpack tool-chain is still working, so I choose ignoring this issue.