Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/benmerckx/gulp-haxe
Haxe for Gulp
https://github.com/benmerckx/gulp-haxe
gulp haxe
Last synced: 2 months ago
JSON representation
Haxe for Gulp
- Host: GitHub
- URL: https://github.com/benmerckx/gulp-haxe
- Owner: benmerckx
- Created: 2016-10-11T16:39:51.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-06T09:23:21.000Z (about 7 years ago)
- Last Synced: 2024-10-06T08:05:10.548Z (3 months ago)
- Topics: gulp, haxe
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/gulp-haxe
- Size: 25.4 KB
- Stars: 10
- Watchers: 5
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gulp-haxe [![NPM Version](https://img.shields.io/npm/v/gulp-haxe.svg)](https://www.npmjs.com/package/gulp-haxe)
### Set a specific haxe version
Gulp-haxe defaults to the latest haxe version. It includes [switchx](https://github.com/lix-pm/switchx) to set your prefered haxe version which can be defined in `package.json` as haxe.version:
```javascript
{
"haxe": {
"version": "3.4.0"
}
}
```### Basic usage
```javascript
const gulp = require('gulp')
const haxe = require('gulp-haxe')gulp.task('compile', function() {
return haxe('build.hxml')
.pipe(gulp.dest('bin'))
})
```### Compile multiple targets
```javascript
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
```javascript
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
```javascript
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'))
})
```### Adding an exit on error flag will result on stream termination and return an error
```javascript
gulp.task('compile', function() {
return haxe('build.hxml', {exitOnError:true})
.pipe(gulp.dest('test'))
})
```