You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ti...@apache.org on 2016/12/21 22:34:25 UTC

cordova-lib git commit: CB-12284 Include project root as additional root for static router

Repository: cordova-lib
Updated Branches:
  refs/heads/master acf7b4873 -> 84fa8e39b


CB-12284 Include project root as additional root for static router

This can be useful in cases where source files that have been transpiled (such as TypeScript files) are located under the project root on a path that mirrors the the transpiled file's path under the platform root, and is pointed to by a map file (otherwise when debugging in a browser, the browser won't be able to find the original source file).


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/84fa8e39
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/84fa8e39
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/84fa8e39

Branch: refs/heads/master
Commit: 84fa8e39b22252381ed4baa6868ff6f22b7a48e2
Parents: acf7b48
Author: TimBarham <ti...@microsoft.com>
Authored: Wed Dec 21 12:18:44 2016 +1000
Committer: TimBarham <ti...@microsoft.com>
Committed: Wed Dec 21 12:18:44 2016 +1000

----------------------------------------------------------------------
 .gitignore                  | 2 +-
 cordova-serve/src/server.js | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/84fa8e39/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index cdd11fe..1cba455 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,7 +6,7 @@ temp
 .DS_Store
 spec-cordova/fixtures/projects/native
 spec-cordova/fixtures/projects/cordova
-.idea/*
+.idea
 .gitcore
 *.jar
 .vscode

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/84fa8e39/cordova-serve/src/server.js
----------------------------------------------------------------------
diff --git a/cordova-serve/src/server.js b/cordova-serve/src/server.js
index bb10a21..9040d2b 100644
--- a/cordova-serve/src/server.js
+++ b/cordova-serve/src/server.js
@@ -55,6 +55,13 @@ module.exports = function (opts) {
         app.use(express.static(opts.root));
     }
 
+    // If we have a project root, make that available as a static root also. This can be useful in cases where source
+    // files that have been transpiled (such as TypeScript) are located under the project root on a path that mirrors
+    // the the transpiled file's path under the platform root and is pointed to by a map file.
+    if (this.projectRoot) {
+        app.use(express.static(this.projectRoot));
+    }
+
     var that = this;
     server.listen(port).on('listening', function () {
         that.port = port;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org