Skip to content

Instantly share code, notes, and snippets.

@sathishvj
Last active January 3, 2017 08:39
Show Gist options
  • Save sathishvj/d53d067e75e33116f6bd055308c2b8e5 to your computer and use it in GitHub Desktop.
Save sathishvj/d53d067e75e33116f6bd055308c2b8e5 to your computer and use it in GitHub Desktop.
godo configuration for automatic `ng build --aot` on file change
// my angular2 project is served from the dist directory (configured in angular-cli.json).
// when there are changes to the code, I use the below configuration with godo (https://github.com/go-godo/godo)
// to automatically build using `ng build --aot
// Put this file as <project>/Gododir/main.go within your web project directory. So, the Gododir and src are at the same level. Then run `godo` from the <project> directory≥.
package main
import do "gopkg.in/godo.v2"
func tasks(p *do.Project) {
p.Task("default", do.S{"ng-build"}, nil)
p.Task("ng-build", do.S{}, func(c *do.Context) {
c.Run(`ng build --aot`)
}).Src(`src/**/*.{scss,ts,html}`).Debounce(10000)
}
func main() {
do.Godo(tasks)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment