Permalink
Browse files
fix(server): typescript watch
- Loading branch information
Showing
with
9 additions
and
4 deletions.
-
+8
−3
src/helpers/TsProject.coffee
-
+1
−1
src/tasks/compile/typescript-server.coffee
|
@@ -27,7 +27,7 @@ class TsProject |
|
|
# =========================================== |
|
|
class Typescript |
|
|
constructor: (@id, @ts, @tsconfig, @opts={}) -> |
|
|
@setProject() |
|
|
return @setProject().getProject() |
|
|
|
|
|
setProject: -> |
|
|
if help.hasTsConfig @tsconfig |
|
@@ -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 |
|
|
|
|
|
|
|
@@ -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() |
|
|
0 comments on commit
3a6791d