Last active
August 29, 2015 14:00
-
-
Save kamiyam/b99ce2008af88d6c9afa to your computer and use it in GitHub Desktop.
Grunt - Middleman Cooperation
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 = (grunt)-> | |
pkg = grunt.file.readJSON 'package.json' | |
for taskName of pkg.devDependencies | |
if taskName.substring(0,6) == 'grunt-' | |
grunt.loadNpmTasks taskName | |
grunt.initConfig | |
external_daemon: | |
mid_serve: | |
cmd: "bundle" | |
args: ["exec","middleman","server"] | |
options: | |
verbose: true | |
typescript: | |
base: | |
src: ['typescript_source/main.ts'] | |
dest: 'source/javascripts/main.js' | |
options: | |
soureMap: true | |
middleman: | |
options: | |
useBundle: true | |
build: | |
options: | |
command: 'build' | |
watch: | |
options: | |
livereload: true | |
typescript: | |
files: ['typescript_source/*.ts'] | |
tasks: ['typescript'] | |
grunt.registerTask 'default', ['typescript','watch'] | |
grunt.registerTask 'build', ['typescript', 'middleman:build'] | |
grunt.registerTask 'serve', ['typescript','external_daemon:mid_serve','watch'] |
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": "middleman_and_typescript", | |
"version": "0.0.0", | |
"description": "", | |
"main": "Grutnfile.coffee", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "k5m", | |
"license": "MIT", | |
"devDependencies": { | |
"grunt": "^0.4.4", | |
"grunt-contrib-watch": "^0.6.1", | |
"grunt-middleman": "^0.1.2", | |
"grunt-typescript": "^0.3.4", | |
"grunt-external-daemon": "^1.1.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment