StarBright

Exporting build from VisualStudio

Recommended Posts

So if you press debug, you see your game launching in the browser?

In terms of release, I have always used grunt or gulp to compile the final release directory.  Chances are you want to eventually minify and stuff for release.  I am not sure how to do it with VS alone :(

Share this post


Link to post
Share on other sites

Hi, I am sure there is no need to install anything else.  I am using VS + Typescript for both Debug and Release builds. First, in properties I have to set build parameters for both Debug and Release - for example I am keeping comments in Debug,... On screenshot below you can see, that you can produce one .js file from all sources, etc. Do not forget to do setup for both Debug and Release (switch on top - "Configuration:" ...):

VS1.thumb.jpg.3822e1e21881b504769a68555f

 I am also running all my minimization tasks and other tasks from project Properties - set Build Events and configure it. Build events are common for Debug and Release, so you need to "code" command line for it it  - see example below

VS2.thumb.jpg.fca34ff27477ce265165f7fbd3

 Whole my builds are one-click made.

 

 

Share this post


Link to post
Share on other sites
Quote

... but I don't understand the part about build events.

 VS can merge output into one file, but it cannot for example to minimize it. For minification or any other further processing you have to run other external tools. If you want to do all this from VS, you can set commands into post-build events. For example take VS output and pass it into minification program (uglify in screenshot).

 While settings for output can be different for Debug and Release and setting is separated, there are no separate build events for Debug and Release. Your build commands are applied to both Debug and Release ... which may be thing you do not want - for example you want to minimize only Release build, but not Debug. So, you have to write your build events so it runs some command only in Debug and some other only in Release. In this case you have to refer to internal VS variables like "ConfigurationName" to find whether build event was called during Debug or Release build...

Share this post


Link to post
Share on other sites

Huh. That sounds easy enough, but when I click index.html in the file explorer it doesn't run the game; I just get a black rectangle the size of the game window. Is that a file paths thing? As far as I can tell the files should be in the right locations relative to index.html.

Share this post


Link to post
Share on other sites

Running game locally does not always work because you need server to run it (mostly for security reasons). When you run it in VS it is run from MS IIS server which is launched in background. Firefox browser can run it without server. Or you can set/install another local server - I am using NPM http-server (https://www.npmjs.com/package/http-server) All I need to do is to go into folder with index.html and type http-server at commandline. Then I can open any browser and put 192.168.0.11:8080 into address bar.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.