Disable Auto Transpiling TS to JS

For some reason Webstorm keeps transpiling my typescript files to javascript.  It's not a big deal, but it seems to slow down the IDE a bit and I get periods of hanging that occur.

I'm already using webpack to transpile, so I don't want this feature enabled.


How do I disable automatic TS to JS transpiling?

4
24 comments

Make sure that 'Enable TypeScript compiler' is disabled in Preferences | Languages & Frameworks | TypeScript, and that you don't have TypeScript file watcher set up in Preferences | Tools | File Watchers

1

Thanks Elena!  That worked!

0

Hey Elena can you let m know how to do the same in Webstorm because I don't find to enable typeScript compiler in languages & framework in preferences.

 

0

In WebStorm 2018.1.x, it's Preferences | Languages & Frameworks | TypeScript, Recompile on changes

 


4

Thanks Elena . It worked.

1

can I enable TypeScript Language Service and disable Javascript generation?

0

Seems like it doesn't work with TypeScript references with emitDeclarationOnly, for instance, in lerna projects. We need to recompile on each change into dist folder in each learna package, so Recompile on Change flag should be checked, but it should not produce .js files, like WS does now

0

please can you provide your tsconfig.json?

0

Hi, It seems to still compile in JS for me,
even though the "recompile on changes" check is off.

What can I do?

0

see if you have any file watchers set up

0

won't that disable the rest of the typescript language services from working?

0

haven't got what you mean, sorry... disabling "recompile on changes" doesn't disable services

0

 

Ok, I think this was created by the Nativescript run command

1

Hello!

After every new startup Recompile on changes is turned on again. I supposed that it is because file watcher, but the trouble is that I do not have File Watcher as stated previously in Preferences | Tools | File Watchers . BUT In my Idea 2019.1.2 Ultimate Edition it is missing? How can I disable it in my case?

Thank you

0

>After every new startup Recompile on changes is turned on again.

seems IDEA has troubles updating your project .xml files... do you have .idea\compiler.xml in your project, what does it look like? Do you version control this file?
Also, please can you try recreating the issue and attach the idea.log?

1

I am having the same issue. Recomplor-on keeps turning on and transpiling occurs.

0

This is not working for me. I have disabled "Recompile on changes" and have no file watchers. It wouldn't be a big issue if it weren't for the debugger behaviour. Adding a breakpoint does nothing and if I add a "debugger" it stops but in the js file.

0

>I have disabled "Recompile on changes" and have no file watchers. 

It must be some other tool then. Make sure that no watchers are run for your project

>It wouldn't be a big issue if it weren't for the debugger behaviour. Adding a breakpoint does nothing and if I add a "debugger" it stops but in the js file.

haven't got how it's related to disabling the auto-transpiling.

Please share a project that can be used to recreate the issue

0

Is it possible to disable TypeScript transpilation on changes for a specific directory in the project?

The use case is in a monorepo with a bunch of microservices, and one web server. The microservice directories benefit from "Recompile on changes", but the webserver does that on its own (webpack, parcel etc.)

0

You can try adding a tsconfig.json with

"compileOnSave": false,

to this specific directory

0

I have a monorepo project with about ~150 typescript files. Dozens of times a day (not sure exact event) WebStorm is auto-compiling some or all of the TypeScript to adjacent JS files and source maps (see the red files in the image - indicating they are not added to GIT).

 

TypeScript compile should not be happening according to settings:

 

Each individual package within the monorepo has its own tsconfig.json, specifying the output location - which is not adjacent, and which works fine within the project's own build process:

 

{
"extends": "../../tsconfig.json",
"include": ["src/**/*"],
"compilerOptions": {
"outDir": "lib",
"declarationDir": "lib",
"rootDir": "src"
}
}

 

The base tsconfig.json looks like this:

 

{
"compilerOptions": {
"experimentalDecorators": true,
"module": "ES2020",
"target": "es2020",
"noImplicitAny": true,
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true,
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true,
"declaration": true,
"declarationMap": true,
"composite": true
},
"references": [
<all the individual TS project references are here>
],
"compileOnSave": false
}

 

I am not using any WebStorm file watchers, I run `tsc -b --watch` from a script, which works correctly with my tsconfig settings and does not put these adjacent JS / map files all over the place. In other words there's nothing else in the environment that I can see would be causing adjacent, compiled versions of my TypeScript files to appear out of nowhere. There's no configuration that would cause adjacent files.

Each time it happens I have to right-click on "Unversioned files" in the Git Local Changes window and select "Delete", which takes a few seconds. It's become highly distracting and frustrating.

How can I completely and definitively prevent WebStorm from doing any TypeScript compilation at all, whilst still keeping the IDE editor error checking?

Thanks

0

Make sure that Recompile on changes is disabled in Settings | Languages & Frameworks | TypeScript. If it doesn't help, then it must be some external tool that is triggered on saving that compiles the files

0

Thanks Elena. As you can see from the screenshot that I provided previously that option is already disabled.

I can find no sign of this mystery external tool, but I have recreated its behaviour. Whilst my main build script in package.json uses tsc with the "-b" option, which does a monorepo-style build of multiple typescript projects in the repo based on the "references" entry in the base tsconfig.json, I can recreate these adjacent files appearing by doing a tsc without the "-b" option and hence ignoring the individual tsconfig.json files in the referenced sub-folders.

I have added the line:

include: []

to my base tsconfig.json, which essentially means it wont compile anything if run without the "-b" flag, and that seems to have stopped the mystery "external tool" from auto-compiling my typescript, leaving my normal build process to run undisturbed and preventing these adjacent files from appearing.

0

Please sign in to leave a comment.