Skip to content

Commit

Permalink
fix(server): typescript watch
Browse files Browse the repository at this point in the history
  • Loading branch information
jyounce committed Aug 31, 2016
1 parent 1747c29 commit 3a6791d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions src/helpers/TsProject.coffee
Expand Up @@ -27,7 +27,7 @@ class TsProject
# ===========================================
class Typescript
constructor: (@id, @ts, @tsconfig, @opts={}) ->
@setProject()
return @setProject().getProject()

setProject: ->
if help.hasTsConfig @tsconfig
Expand All @@ -36,15 +36,20 @@ class TsProject
@project = @ts.createProject @opts
@

getProject: ->
@project

# static method to retrieve an
# instance or create a new one
# ============================
@get: (id, ts, tsconfig, opts) ->
if not instances[id] # create new instance
# console.log "TS INSTANCE ID: #{id}".alert
instances[id] = new Typescript id, ts, tsconfig, opts
instances[id]
instances[id].project

# Export Class!
# =============
module.exports = TsProject
module.exports = TsProject


2 changes: 1 addition & 1 deletion src/tasks/compile/typescript-server.coffee
Expand Up @@ -31,7 +31,7 @@ module.exports = (config, gulp, taskOpts={}) ->
fileBase = paths.src
tsProject = TsProject.get 'server', ts, paths.tsconfig
gulp.src src
.pipe(ts tsProject.project).js
.pipe(ts tsProject).js
.pipe updateFileBase fileBase
.pipe gulp.dest paths.dest
.on 'end', -> defer.resolve()
Expand Down

0 comments on commit 3a6791d

Please sign in to comment.