0.4.5 • Published 7 years ago

gulp-haxe v0.4.5

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

gulp-haxe NPM Version

Set a specific haxe version

Gulp-haxe defaults to the latest haxe version. It includes switchx to set your prefered haxe version which can be defined in package.json as haxe.version:

{
  "haxe": {
    "version": "3.4.0"
  }
}

Basic usage

const gulp = require('gulp')
const haxe = require('gulp-haxe')

gulp.task('compile', function() {
  return haxe('build.hxml')
    .pipe(gulp.dest('bin'))
})

Compile multiple targets

gulp.task('compile', function() {
  return haxe([{
    main: 'Client',
    js: 'assets/main.js'
  }, {
    main: 'Server',
    php: 'server'
  }])
    .pipe(gulp.dest('public'))
})

Using the completion server and watching for changes

gulp.task('compile', function() {
  return haxe(
    {cp: 'src', main: 'Client', js: 'client.js'},
    {completion: 6000} // Starts the server and connects for you on port 6000
  )
    .pipe(gulp.dest('public'))
})

gulp.task('watch', function() {
  gulp.watch(['src/**/*.hx'], ['compile'])
})

gulp.task('default', ['compile', 'watch'])

Uglify and include sourcemaps

gulp.task('compile', function() {
  return haxe({
    main: 'Main', 
    lib: ['tink_core', 'tink_macro'], 
    js: 'build.js',
    debug: true // Required for sourcemaps
  })
    .pipe(sourcemaps.init())
    .pipe(uglify())
    .pipe(sourcemaps.write())
    .pipe(gulp.dest('bin'))
})
0.4.5

7 years ago

0.4.4

7 years ago

0.4.3

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.0

8 years ago