GitHub user TimBarham opened a pull request:
https://github.com/apache/cordova-lib/pull/512
CB-12284 Include project root as additional root for static router
### Platforms affected
All
### What does this PR do?
With this change, cordova-serve includes the project root as an additional
root for static routing. This is the final piece a middleware, so will only be
utilized when a file isn't found through other means (the default static
routing which points to the platform root, or other middleware that may have
been injected by a third party).
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).
### What testing has been done on this change?
Verified is resolved the problem reported in the bug, and lets you debug
using original TypeScript sources in a TypeScript project, as long as the path
to the TypeScript source relative to the project root mirrors the path to the
generated JavaScript and map file relative to the www folder.
### Checklist
- [x] [Reported an issue](http://cordova.apache.org/contribute/issues.html)
in the JIRA database
- [x] Commit message follows the format: "CB-3232: (android) Fix bug with
resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform
affected.
- [ ] Added automated test coverage as appropriate for this change.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/TimBarham/cordova-lib CB-12284
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cordova-lib/pull/512.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #512
----
commit 84fa8e39b22252381ed4baa6868ff6f22b7a48e2
Author: TimBarham <[email protected]>
Date: 2016-12-21T02:18:44Z
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).
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]