Skip to content

Instantly share code, notes, and snippets.

@trkrameshkumar
Last active June 12, 2017 11:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trkrameshkumar/2d944e81f4a882c785662c4aa27fa008 to your computer and use it in GitHub Desktop.
Save trkrameshkumar/2d944e81f4a882c785662c4aa27fa008 to your computer and use it in GitHub Desktop.
module.exports = function( grunt ) {
grunt.initConfig({
'http-server': {
'dev': {
root: "..",
port: 8080,
host: "0.0.0.0",
cache: 0,
showDir : true,
autoIndex: true,
ext: "html",
runInBackground: true,
logFn: function(req, res, error) { },
openBrowser : false,
customPages: {
"/readme": "README.md"
}
}
},
watch:{
options:{livereload:true},
files:['../app/**','../css/**','../templates/**', '../main.js'],
tasks:['requirejs'],
options: {
livereload: true,
}
},
requirejs: {
compile: {
options: {
baseUrl: '..', // 1
out: '../output.min.js', // 2
name: 'bower_components/almond/almond', // 3
include: 'main', // 4
mainConfigFile: '../config.js' // 5
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-http-server');
grunt.registerTask('server',['http-server:dev','requirejs','watch']);
};
{
"name": "requirejs-task-runner",
"description": "Task runner for require JS",
"version": "0.0.1",
"main": "gruntfile.js",
"devDependencies": {
"grunt": "~0.4.5",
"grunt-contrib-requirejs": "~0.4.4"
},
"dependencies": {
"grunt-contrib-watch": "^1.0.0",
"grunt-http-server": "^2.0.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment