scottmcdonnell / phaser-typescript-webpack-starter

A simple starter example for using Phaser with Webpack and TypeScript.
MIT License
1 stars 1 forks source link

Support Phaser 2.4.8 #1

Open scottmcdonnell opened 8 years ago

scottmcdonnell commented 8 years ago

There is a Phaser issue with the latest release causing typescript compilation errors.

The workaround at the moment is to use the v2.4.6 until the 2.4.9 release hopefully fixes errors.

kikemx78 commented 8 years ago

Hi there, trying to run your starter pack with no success. Using Phaser 2.4.6

ERROR in [default] C:/Users/kikemx78/Desktop/phaser-typescript-starter/src/app/Game.ts:3:24 Cannot find module 'phaser'.

And so may others....

Any clue?? captura

scottmcdonnell commented 8 years ago

@kikemx78 Phaser definition file reference now added. Can you try again?

kikemx78 commented 8 years ago

scottmcdonnell No change at all after adding your last commit on typings/extra.d.ts

kikemx78 commented 8 years ago

scottmcdonnell Brief update...getting same errors even with a small build ... captura

`var path = require('path');
  var webpack = require('webpack');

  var phaserModule = path.join(__dirname, '/node_modules/phaser/');
  var phaser = path.join(phaserModule, 'build/custom/phaser-split.js'),
  pixi = path.join(phaserModule, 'build/custom/pixi.js'),
  p2 = path.join(phaserModule, 'build/custom/p2.js');

  module.exports = {
   entry: "./src/entry.ts",
   output: {
   path: "./dist/",
   filename: "./dist/bundle.js"
  },
 watch: true,
 module: {
   loaders: [
     { test: /\.css$/, loader: "style!css" },
     { test: /\.ts$/, loader: 'ts-loader' },
     { test: /pixi.js/, loader: "script" },
    ]
},
   resolve: {
    extensions: ['', '.webpack.js', '.web.js', '.ts', '.js'],
       alias: {
        'phaser': phaser,
        'pixi.js': pixi,
        'p2': p2,
      }
    },

  > };`
scottmcdonnell commented 8 years ago

@kikemx78 the latest commit is working for me in a fresh clone on node 5.4 and npm 3.6. Try a fresh clone to a new folder or

#clean up all files
npm run clean

#fresh install of node modules
npm install

#run dev server
npm start
kikemx78 commented 8 years ago

@scottmcdonnell It does works...thanx a lot !!