Created
May 4, 2016 01:22
-
-
Save rchrd2/7732154c40dcf92e7084f76db4cf341b to your computer and use it in GitHub Desktop.
Example gruntfile for react
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
grunt.initConfig({ | |
watch: { | |
files: [ | |
'src/**/*.js', | |
'src/**/*.jsx' | |
], | |
tasks: ['browserify'] | |
}, | |
browserify: { | |
dist: { | |
options: { | |
transform: [ | |
['babelify', {presets: ['es2015', 'react']}] | |
] | |
}, | |
src: ['src/app.js'], | |
dest: 'build/app.build.js', | |
} | |
}, | |
}); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.loadNpmTasks('grunt-browserify'); | |
grunt.registerTask('default', ['browserify']); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "grunt-example", | |
"version": "1.0.0", | |
"description": "Grunt example", | |
"main": "index.js", | |
"dependencies": {}, | |
"devDependencies": { | |
"babel-preset-es2015": "^6.6.0", | |
"babel-preset-react": "^6.5.0", | |
"babelify": "7.3.0", | |
"grunt": "^1.0.1", | |
"grunt-babel": "^6.0.0", | |
"grunt-browserify": "5.0.0", | |
"grunt-contrib-watch": "^1.0.0" | |
}, | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"keywords": [ | |
"Internet", | |
"Archive" | |
], | |
"author": "Richard Caceres", | |
"license": "AGPL-3.0" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment