nerdenough Posted March 19, 2018 Share Posted March 19, 2018 Hey folks, New version of Phaser CLI is here: https://github.com/phaser-cli/phaser-cli. Phaser CLI is based on the latest versions of Create React App and vue-cli, and is designed to provide a zero-config setup for your Phaser projects. Getting started: npm install -g @phaser-cli/cli # or yarn global add @phaser-cli/cli phaser create my-project cd my-project npm start # serves your project at localhost:8080 npm run build # builds for production Currently implemented: Basic template with Babel support Linting with Standard Webpack 4 Webpack Dev Server Ability to eject from Phaser CLI Coming soon™️: Support for additional templates (e.g TypeScript, CoffeeScript) Support for multiplayer games via socket.io More linting options (e.g ESLint, ESLint + Standard, ESLint + AirBnB) Add some tests into the templates Integrate Travis/AppVeyor for automated testing/deployment of Phaser CLI And likely a few other things yet to be decided. Phaser CLI is still a work in progress (read: bugs!) so please yell if you're having any issues. Any contributions to the code and other suggestions are very much appreciated ? nkholski, samme and msickle 3 Link to comment Share on other sites More sharing options...
nerdenough Posted April 7, 2018 Author Share Posted April 7, 2018 A few decent fixes have been added recently, particularly fixing an error that broke the cli when using npm instead of yarn. Webpack configs have also been updated to be more performant and some of the scripts have been tidied up. In the next couple of weeks I plan to add the ability to customise the creation of a project, starting off with linting choices (ESLint, ESLint + Standard, ESLint + Airbnb, ESLint + Prettier) and then adding in TypeScript support. Koekenbakker28 1 Link to comment Share on other sites More sharing options...
nkholski Posted April 8, 2018 Share Posted April 8, 2018 Just tested it. Worked great to install (except it had a conflict against other service using port 8080). Is it possible to keep assets out of the src folder and avoid using import? Link to comment Share on other sites More sharing options...
nerdenough Posted April 8, 2018 Author Share Posted April 8, 2018 5 minutes ago, nkholski said: Just tested it. Worked great to install (except it had a conflict against other service using port 8080). Is it possible to keep assets out of the src folder and avoid using import? Thanks for the feedback, really appreciate it! Currently it doesn't support "assets" in the root directory without import (with import it's fine), but will definitely look at adding in support for it. However the "static" folder can be used as a workaround for the time being, as it's just copied straight to the build directory. You should be able to specify a custom port when running the dev server: e.g. "PORT=3000 npm start" - I just need to get around to writing some decent documentation ? Link to comment Share on other sites More sharing options...
nkholski Posted April 8, 2018 Share Posted April 8, 2018 I've tried to put my assets folder in static but I get a 404 when trying to load an image: "/assets/image.png". Link to comment Share on other sites More sharing options...
nerdenough Posted April 8, 2018 Author Share Posted April 8, 2018 13 minutes ago, nkholski said: I've tried to put my assets folder in static but I get a 404 when trying to load an image: "/assets/image.png". You would have to reference it as "/static/assets/image.png" at the moment but ideally it would be what you have above. The main reason I favoured imports over static assets was for cache busting via webpack. Link to comment Share on other sites More sharing options...
Recommended Posts