-
Notifications
You must be signed in to change notification settings - Fork 129
Wrong output file location #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I am not using I am using I thought it was a My
Just wanted to share my information... maybe it's a bug in typescript. |
Well, indeed, it seems like a TypeScript compiler bug. I tried to compile the same files as above with the
It created two files. An empty file in a correct directory, and a correct file in a wrong directory.
However, running the same commands on another ts file produced correct results. The only difference between two ts files, is that one uses import directive, and the other one does not.
The way to fix the problem is to replace
|
That's strange indeed. It looks like an issue with typescript, as you could reproduce it with @mhegazy @DanielRosenwasser Any idea what's going on? |
Perhaps; @aradzie, can you try out TypeScript 1.5-beta as @ivogabe suggested and let us know what the result is? If you're still running into the problem, I'd create a new bug on the TypeScript GitHub repo and link back to this issue.
Yup, that's because when you use an |
Well, I tried it with the latest tsc from the master branch checked out a few minutes ago.
The result is the same, an empty file is generated. However, this might be as intended. I never used external modules in my TS projects before, so the result came as a surprise for me. From my prior experience with TS, I find this behavior counter-intuitive. Now I can't decide, if it's my lack of knowledge, or really a bug. Here is my test set up ./src/main.ts
./src/module1.ts
./src/module2.ts
./build.sh
And the result of compilation:
The TSC creates a separate JS file for every TS module, including However, I would prefer another compilation model, where every TS module is compiled by a separate invocation to the TSC, and the Let me explain. The project I am working on does not define any amd/commonjs modules. It only generates a simple standalone script that |
This is strange. I am pulling may hair out, cannot figure out what is wrong with my gulpfile. It contains two identical TS compile tasks, one produces a correct JS file, another does not.
The tasks are defined as follows:
The only difference between tasks is that one takes
app1.ts
and producesapp1.js
. Another takesapp2.ts
and producesapp2.js
.The project directory layout is as follows:
The first task produces a correct JS file:
However, the second task produces the following files:
Please note that the wrong directory is concatenation of the output directory and the source directory paths.
The problem goes away if I remove module option from the second task. E.g., remove the following line:
The text was updated successfully, but these errors were encountered: