Reputation: 738
I'm trying to get the angular2 quick start example working in my environment.
My only viable option for serving the app is as a plugin to an application that is already installed on my system. That application presents a webserver that uses a '//' in the path to the plugin where it should serve the information from.
Something like this:
http://localhost:3000/Project/project-name
//plugin-name/ng2qs/index.html
I can't modify that behavior.
Currently when typescript loads the file it removes that '//' as part of it's normalization of the URL (function normalizePath(path)
). When it then requests the file at http://localhost:3000/Project/project-name
/plugin-name/ng2qs/index.html
it gets an error (404) and fails the transpile process.
There is a line in typescript.js
where the trouble starts.
var sourceFile = ts.createSourceFile(inputFileName, input, options.target);
In this line the inputFileName
is correct, but the return value of sourceFile.fileName
contains the wrong name. Part of what I find interesting is that the input
parameter already contains the contents of the file at inputFileName
. And sourceFile.text
contains the contents of the file.
Is there a setting that makes it either skip the removal of the //
or makes it use the already in memory copy of the file for the transpilation.
Yes I'm keeping the transpiler portion of things so this is relevant, saying to use npm and node to compile it ahead of time is not helpful, so please don't bother.
Upvotes: 1
Views: 51
Reputation: 276125
For record its been fixed in TypeScript master : https://github.com/Microsoft/TypeScript/pull/8481
npm install typescript@next
Upvotes: 1