GeezerVison is showing github.com — Backslash in reference path causes Visual studio 2013 to drop js in wrong directory · Issue #2152 · microsoft/TypeScript
Backslash in reference path causes Visual studio 2013 to drop js in wrong directory #2152DescriptionSelect Redirect Javascript output to directory.
Create ts with reference to another ts using backslash for path.
Build.Look for resulting javascript file in windows explorer. Activitymhegazy commented on Feb 26, 2015 I will need more information to be able to reproduce this issue locally.
here is my setup:
output directory: "out"
// file2.ts
/// <reference path="c:\users\mhegazy\documents\visual studio 2015\Projects\TypeScriptHTMLApp3\TypeScriptHTMLApp3\file1.ts" />
var f2 = 2;
after build, i see out to include file1.js and file2.js glaborde commented on Mar 5, 2015 Hello Mohamed,
sorry for not getting back sooner on this.
I spent a little more time to characterize this problem. We actually had
made two changes to try to fix this problem. One was the backslash. The
other was to move the ts file to the root of the project (which
incidentally is the fix that worked).
The problem is that the reference path is also the relative location to the
resulting js file.
For example, redirecting Javascript output to Resources, if I put my
typescripts in a sub directory (scripts\mystuff), the javascript drops
under: Resources\scripts\mystuff.
By putting the scripts on the root, the resulting javascript drops under
Resources as expected. Forward slash versus backslash doesn't affect this
behavior.
I am looking for a behavior where the compilation outputs are dropped in a
single location irrespective of the relative location of the typescripts.
What do you think?
Guy
On Thu, Feb 26, 2015 at 10:53 AM, Mohamed Hegazy [email protected]
wrote:
I will need more information to be able to reproduce this issue locally.
here is my setup:
output directory: "out"
// file1.tsvar f1 = 1;
// file2.ts/// var f2 = 2;
after build, i see out to include file1.js and file2.js
—
Reply to this email directly or view it on GitHub
#2152 (comment)
.
mhegazy commented on Mar 8, 2015 The output folder structure is dependent on the "best common path" of the input. I think what you want is a --projectRoot or --commonSourcePath option to force the compiler to generate outputs to mirror a specific input folder structure. glaborde commented on Mar 10, 2015 Hello Mohamed,
what I am looking for is a single output directory (Resources) in which all
the javascripts would be created. No sub directories. What you are
describing is I think the current behavior. The output directory is in
reality the root for the output and not the output directory.
Does that make sense?
Guy
On Sun, Mar 8, 2015 at 1:06 PM, Mohamed Hegazy [email protected]
wrote:
The output folder structure is dependent on the "best common path" of the
input. I think what you want is a --projectRoot or --commonSourcePath
option to force the compiler to generate outputs to mirror a specific input
folder structure.
—
Reply to this email directly or view it on GitHub
#2152 (comment)
.
mhegazy commented on Mar 10, 2015 when you call the compiler with --outDir outputDirectoryPath, it tries to miror the inpyt directory structure under outputDirectoryPath.
The trick here is to figure out the "root" of the input. so if you have this directory structure:
folder1
|- a.ts
|- folder2
|- b.ts
|-c.ts
calling the compiler with ` b.ts c.ts --outDir outputDirectoryPath mhegazy commented on Mar 10, 2015 When you call the compiler with --outDir outputDirectoryPath, it tries to mirror the input directory structure under outputDirectoryPath.
The trick here is to figure out the "root" of the input. so if you have this directory structure:
folder1
|- a.ts
|- folder2
|- b.ts
|- c.ts
Calling the compiler with b.ts c.ts --outDir outputDirectoryPath, will result in a common directory of folder1\folder2 and in turn will generate this output folder structure:
outputDirectoryPath
|- b.ts
|- c.ts
adding a.ts to the input a.ts b.ts c.ts --outDir outputDirectoryPath, will result in a making the common directory of folder1 and in turn will generate this output folder structure:
outputDirectoryPath
|- a.ts
|- folder2
|- b.ts
|- c.ts
I think what you need, is a way to tell the compiler, regardless of my inputs, always consider folder1 as my input root, and generate the output accordingly. liciniomendes commented on Jul 31, 2015 mhegazy commented on Jul 31, 2015 @licinioamendes i have logged #4109 to track that issue. mhegazy commented on Dec 10, 2015 this is addressed by --rootDir: #2772
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|