npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

grunt-haxe

v0.1.13

Published

Compile Haxe to JavaScript

Downloads

77

Readme

Grunt-Haxe

Compile Haxe to JavaScript

Haxe is an open-source, multi-platform programming language with many advanced features. Visit the [Haxe website] haxe_www to learn more. A list of advanced features can be found here.

Getting Started

Install this grunt plugin next to your project's grunt.js gruntfile with: npm install grunt-haxe --save-dev

(Note: install v0.1.7 of this plugin if you are still using Grunt v0.3)

Then add this line to your project's grunt.js gruntfile:

grunt.loadNpmTasks('grunt-haxe');

Documentation

###Overview

Inside your grunt.js file, add a section named haxe. Use this section to define the arguments that will be passed to the Haxe compiler

###Config Examples

Minimal Example

A project requires at least the following three properties in order to successfully compile:

haxe: {
	minimal_example: {
		main: 'Main', /*name of the startup class*/
		classpath:['app'],/*specify folder/s where source code is located*/
		output:'dist/output.js' /*compile to this file*/
	}
}

The Haxe project called 'minimal_example' can then be compiled using the following command:

$ grunt haxe:minimal_example

Complete Example

This example shows all available options for configuring your project;

haxe: {
	complete_example: {
		main: 'Main',
		classpath:['app'],
		libs:['casalib'], /*specify haxelib libraries */
		flags:['something', 'createjs'], /* define conditional compilation flags */
		macros:['Mymacro.doSomethingCool()'], /*call the given macro*/
		resources:['activity/xml/map-layout.json@map_layout'], /*define named resource files*/
		misc:['-debug', "--dead-code-elimination", "--js-modern"],/* add any other arguments*/
		output:'app/scripts/output.js',
		onError: function (e) {
			/*custom error message */
			console.log( 'There was a problem...\n' + e );
		},
		force:true /*continue processing task (like --force)*/
	}
}

Composite Example

The value of the option property is typically a string that defines the name and location of a file to compile to but it can also be an object literal that in turn contains an output property.

The following example shows how to configure debug and release builds for a project by defining common properties for both in a single place. Unique settings for each build are then nested;

haxe: {
	multi_target_example: {
		main: 'Main',
		classpath:['app'],
		output:{
			debug:{
				misc:['-debug'],/*-debug results in a js source map*/
				output: 'dist/output.js'
			},
			release: {
				misc:["--dead-code-elimination", "--js-modern"],
				output: 'app/scripts/output.js'
			}
		}
	}
}

HXML Example

The standard Haxe build file is a .hxml file. This can be used as an alternative to defining all the properties directly in the grunt file.

haxe: {
	hxml_example: {
		hxml: 'build.hxml'
	}
}

License

Copyright (c) 2012 Fintan Boyle
Licensed under the MIT license.