I'm currently attempting to implement the angular2 quick start example in my local environment.
The only feasible way for me to serve the application is as a plugin within an existing application on my system. This particular application hosts a web server that incorporates '//' in the path to the plugin where the information should be served from.
Here is an example of the URL structure:
http://localhost:3000/Project/project-name
//plugin-name/ng2qs/index.html
Unfortunately, I am unable to alter this behavior.
At present, when typescript loads the file, it strips out the '//' during the normalization of the URL (function normalizePath(path)
). Consequently, when it attempts to fetch the file at
http://localhost:3000/Project/project-name
/plugin-name/ng2qs/index.html
, it encounters an error (404) and fails during the transpile process.
The issue appears to originate from a specific line in typescript.js
.
var sourceFile = ts.createSourceFile(inputFileName, input, options.target);
In this line, the value of inputFileName
is correct; however, the result of sourceFile.fileName
contains an incorrect name. It intrigues me that the input
parameter already holds the file contents located at inputFileName
, with sourceFile.text
containing said contents.
Is there a setting that prevents the removal of //
or instructs TypeScript to utilize the in-memory copy of the file for transpilation?
Just to clarify, I prefer retaining the transpiler component within this context. Any suggestions advising the use of npm and node for precompilation are not beneficial to me, so I kindly request avoiding such recommendations.