Skip to content

Instantly share code, notes, and snippets.

@cecilemuller
Last active December 16, 2015 08:39
Show Gist options
  • Save cecilemuller/5407309 to your computer and use it in GitHub Desktop.
Save cecilemuller/5407309 to your computer and use it in GitHub Desktop.
Setup Typescript in FlashDevelop with minification via Google Closure

Installation

  1. First, install Flashdevelop and make sure to select Install JS Compiler.

  2. Then install NodeJS which conveniently installs both Node.JS and its package manager NPM.

  3. Finally, open a command line prompt (the shortcut is Windows + R) and run npm install -g typescript.

Per-project

  1. Go to ProjectNew ProjectTypeScript App and set the project name and folder, which creates two folders src (for the typescript sources) and bin for the javascript output and HTML page.

  2. Now go to ProjectProject PropertiesBuild and set the Post-Build Command Line to java -jar "$(ToolsDir)\google\compiler.jar" --js "bin/YourAppName.js" --js_output_file "bin/YourAppName.min.js". That way, it generates both YourAppName.js and YourAppName.min.js in the bin folder when you build or test.

  3. And finally, open index.html and change the script src to YourAppName.min.js instead of YourAppName.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment