Webstorm removing CoffeeScript map file comment.
I am evaluating WebStorm in Linux (Kubuntu 21.04) for use with CoffeeScript and node. I am using the command line:
--bare --map --compile $FileName$
in the CoffeeScript watcher. If I then go to my index.coffee and press space and wait a second or two, it auto saves and generates the map file every time, just fine. The problem is that it seems completely random whether the map file tag will show up or not in the .js file.
About half the time the last line in index.js will be "//# sourceMappingURL=index.js.map" and the rest of the time there is just nothing there except the code.
I can use the same command line in the terminal and the map file tag is in the index.js every time. Webstorm seems to be actively removing it from the .js files generated by CoffeeScript...sometimes. It doesn't matter if I save manually of let it auto save.
Any ideas why? I can get around it by using backticks to embed the map tag line myself in each file (and then it will sometimes have 2 map lines), but I don't understand why this is happening.
Please sign in to leave a comment.
The IDE for sure doesn't delete anything from the generated code
It is either a problem with the compiler (can be related to multiple compiler processes accessing the same file concurrently as a result of triggering the watcher on each change made to a file) or a result of running some other tools watching and modifying the generated files
To decrease the number of compilations you may disable Auto-save edited files to trigger the watcher in the File Watcher settings. In this case file will get compiled only on explicit Save or on IDE frame deactivation
Well, the other problem I was having was that it would always auto-save when I stopped typing. I turned off every option I could find for it and it still did it.
It turns out I still had another minimized copy of WebStorm open with a test project on another desktop. I closed it and everything is working ok now.
Sorry for wasting your time.