Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble with webpack build #34

Closed
Creta5164 opened this issue Feb 22, 2019 · 12 comments
Closed

Trouble with webpack build #34

Creta5164 opened this issue Feb 22, 2019 · 12 comments

Comments

@Creta5164
Copy link

Creta5164 commented Feb 22, 2019

image

Plugin can't detect Phaser (based on Pixijs) bundled from webpack.
how can I inspect with this?

@csomakk
Copy link
Collaborator

csomakk commented Feb 22, 2019

works for me on https://phaser.io/examples/v2/animation/animation-events
can you try that one please?

@Creta5164
Copy link
Author

Creta5164 commented Feb 22, 2019

Yeah sure that works fine, but, I mean if Pixi(or Phaser) library bundled by webpack, debugger can't detect it.
https://webpack.js.org/

@Creta5164
Copy link
Author

Creta5164 commented Feb 22, 2019

Here's my webpack config file.

const path = require('path');

module.exports = {
    context: path.resolve(__dirname, 'wwwroot', 'Core'),
    entry: path.join(__dirname, 'wwwroot', 'Core', '/Main.ts'),
    output: {
        filename: 'game-core.js',
        path: path.join(__dirname, 'wwwroot', 'js')
    },
    module: {
        rules: [
            {
                test: /\.tsx?$/,
                loader: 'ts-loader',
                exclude: /node_modules/,
            },
            { test: /\.js$/, loader: 'source-map-loader', enforce: 'pre' }
        ]
    },
    resolve: {
        extensions: [".tsx", ".ts", ".js"]
    },
    devtool: 'eval-source-map'
};

And this is entry point (Called from Main.ts)

import * as Phaser from 'phaser';

export class GameManager
{
    /** RootUrl for resources of game. */
    private static RootUrl: string;
    
    /** Current Phaser program. */
    private static Application: Phaser.Game;
    
    public static Init(url :string) :void
    {
        this.SetupUrl(url);
        
        if (this.Application != null) {
            this.Application.destroy(true);
            this.Application = null;
        }
        
        this.Application = new Phaser.Game({
            type: Phaser.AUTO,
            width: 800,
            height: 600,
            
            physics: {
                default: 'arcade'
            },
            
            scene: {
                preload: this.OnPreload,
                create:  this.OnApplicationReady
            }
            
        });
    }
...

@csomakk
Copy link
Collaborator

csomakk commented Feb 22, 2019

if you can share a sample minimal project with your webpack setup, etc, on the weekend i might have a few mins to look into it. My guess that the detection runs only once there..

@Creta5164
Copy link
Author

Creta5164 commented Feb 22, 2019

Repository : https://github.com/Project-Seiklus/SeiklusRPG-Editor/tree/core-function

  1. open Core folder using vscode

  2. Ctrl + ` to open terminal with current path.

  3. Run npm install

  4. Run ./node_modules/.bin/webpack --config webpack.config.js

  5. Open index.html in wwwroot folder.

  6. (External) Install .NET Core SDK 2.0 or higher and launch debug mode in vscode (automatically setup)
    image

@TombolaShepless
Copy link

Also having this exact issue

@bfanger
Copy link
Owner

bfanger commented Feb 23, 2019

You'll need to manually register the PIXI variable to the pixi inspector.

window.__PIXI_INSPECTOR_GLOBAL_HOOK__ &&  window.__PIXI_INSPECTOR_GLOBAL_HOOK__.register({ PIXI: window.PIXI });

https://github.com/bfanger/pixi-inspector/blob/master/tests/example.js#L7-L8

@Creta5164
Copy link
Author

image

__PIXI_INSPECTOR_GLOBAL_HOOK__.register({ PIXI: window.Phaser });

It looks like detected it, but it does not seem to find the application.

@bfanger
Copy link
Owner

bfanger commented Feb 24, 2019

You're passing Phaser, not PIXI. Phaser used to have Phaser.PIXI. if you also pass Phaser to the register method it'll show the phaser icon and version

@Creta5164
Copy link
Author

image

__PIXI_INSPECTOR_GLOBAL_HOOK__.register({ PIXI: window.Phaser.PIXI });

There's doesn't exist PIXI :|

@themoonrat
Copy link

Phaser 3 no longer uses PixiJS as its renderer

@Creta5164
Copy link
Author

http://www.html5gamedevs.com/topic/34261-does-phaser-3-use-pixijs/

I just found this thread... okay so close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants