Skip to content

Instantly share code, notes, and snippets.

@ssorallen
Last active August 29, 2015 13:57
Show Gist options
  • Save ssorallen/9755591 to your computer and use it in GitHub Desktop.
Save ssorallen/9755591 to your computer and use it in GitHub Desktop.
var fs = require('fs');
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
env: {
build: {
NODE_ENV: 'production'
}
},
browserify: {
dev: {
options: {
debug: true,
transform: ['reactify']
},
files: {
'public/build/build.js': 'public/js/**/*.jsx'
}
},
build: {
options: {
debug: false,
transform: ['reactify']
},
files: {
'public/build/build.js': 'public/js/**/*.jsx'
}
}
},
watch: {
browserify: {
files: ['public/js/**/*.js', 'public/js/**/*.jsx'],
tasks: ['browserify:dev']
},
options: {
nospawn: true
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-env');
grunt.registerTask('default', ['watch']);
grunt.registerTask('build', ['env:build', 'browserify:build']);
};
{
"name": "reactjs",
"version": "0.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"react": "~0.10.0-rc1",
},
"devDependencies": {
"envify": "~1.2.1",
"grunt": "~0.4.4",
"browserify": "~3.33.0",
"grunt-browserify": "~1.3.2",
"grunt-contrib-watch": "~0.6.1",
"reactify": "~0.10.0",
"grunt-env": "~0.4.1"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "BSD"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment