Skip to content

Instantly share code, notes, and snippets.

@Mistat
Created August 5, 2015 10:08
Show Gist options
  • Save Mistat/e0a4f2c1a52c3f9132a2 to your computer and use it in GitHub Desktop.
Save Mistat/e0a4f2c1a52c3f9132a2 to your computer and use it in GitHub Desktop.
Titanium + Babel + Alloy
var path = require('path');
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
babel: {
options: {
sourceMap: true,
stage: 0
},
dist: {
files: [{
"expand": true,
"cwd": "src",
"src": ["**/*.js"],
"dest": "app/",
"ext": ".js"
}]
}
},
copy: {
all: {
files: [
{expand: true, cwd: "src" , src: ['**/*', '!**/*.js'], dest: 'app/'},
]
},
},
alloy: {
compile: {
options: {
command: 'compile',
platform: 'ios',
outputPath: './'
}
}
},
tishadow: {
options: {
projectDir: './',
update: true,
withAlloy: true,
},
run: {
command: 'run',
options: {
alloy: {
platform: [ 'ios' ]
}
}
}
},
watch: {
all: {
files: ['src/**/*.js'],
tasks: ['babel', 'tishadow:run']
}
}
});
grunt.registerTask('default', ['babel', 'copy', 'alloy']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment