-
Notifications
You must be signed in to change notification settings - Fork 11
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
Including .js
files in input causes "error TS5055: Cannot write file '_filename.js_' because it would overwrite input file."
#768
Comments
.js
files in input causes "error TS5055: Cannot write file '_filename.js_' because it would overwrite input file..js
files in input causes "error TS5055: Cannot write file '_filename.js_' because it would overwrite input file."
Two additional questions, if you would be so kind:
|
Hi, thank you for the detailed report. The build setup of the blockly repository looks quite complicated, but I see some points that need to be addressed to begin with. Firstly, I see several closure-style JS files are being fed. Those should only be fed to closure compiler, not to tsickle. To achieve this, in Next, I see several files which reference import * as goog from '../closure/goog/goog.js'; It should be replaced with ///<reference path="../node_modules/@tscc/tscc/third_party/closure_library/base.d.ts" />
import * as goog from 'goog:goog';
Another painful issue is that the entry file must be TS, not a closure-js as it is in the goog.require('Blockly.libraryBlocks.logic'); must be changed to import 'goog:Blockly.libraryBlocks.logic' The All these look quite labouring, and it is definitely not the best explanation of what need to be done, but if this makes any sense, I see no fundamental issue that would prevent tscc from working in the blockly repo, so I'd say it's promising. |
Regarding your additional questions –
|
As reported in #768 (comment), declarationMap flag may cause the compilation to error out if declaration is set to false. The rationale is that it would be a bad experience if tsc succeeds but tscc fails for no apparent reason.
I'm trying to establish if
tscc
would be a suitable tool for building Blockly, which is currently built usingtsc
and Closure Compiler (running inSIMPLE_OPTIMIZATIONS
mode in part due to incompatibility betweentsc
output forenum
and Closure Compiler's prohibition on quoting property names—presumably one of the motivations for the creation of tscikle in the first place).At the moment I have checked out our
develop
branch and am trying to compile our advanced compilation test (which verifies that Blockly can be built usingADVANCED_OPTIMIZATIONS
) by modifying ourtsconfig.json
to:and added a simple
tscc.spec.json
:Unfortunately, running tscc generates errors for each
.js
file included in the build:I tired using
tsc
's -outputDir` flag, but this just generated a warning that it was ignored:which is why I added the
prefix
directive totscc.spec.json
. But it appears thatprefix
is applied only to the output of closure compiler, not the output oftsc
.How can I build a project containing a mix of
.ts
and.js
input files? Given thatbase.js
is mandatory for Closure-based projects, this is presumably supported somehow.The text was updated successfully, but these errors were encountered: