I'm using the brand new Visual Studio Code editor for some TypeScript. And, trying to import some classes from a d.ts
like this:
import Polygon = require('esri/geometry/Polygon');
But, I'm getting a red squiggly that says:
Cannot compile external dependencies unless the --module flag is provided
My question is, where do I provide that flag? I believe it's a flag to the TypeScript compiler. In Visual Studio, it's a checkbox on the project. But in Code, I can't find any editor setting for that.
To load only modules you specify from the symbol file locations, select Load only specified modules. Select Specify included modules, select the + icon, type the names of the modules to include, and then select OK. The symbol files for other modules are not loaded.
When debugging managed code on a remote device, all symbol files must be located either on the local machine, or in a location specified in the debugger options. The debugger also searches for symbol files in the following locations: The location that is specified inside the DLL or the executable ( .exe)...
Work with symbols in the Modules window Option Description Load Symbols Appears for modules with skipped, not fo ... Symbol Load Information Shows the location of a loaded symbol fi ... Symbol Settings Opens the Options > Debugging > Symbols ... Always Load Automatically
On the Tools > Options > Debugging > Symbols page, you can: Specify and select search paths and symbol servers for Microsoft, Windows, or third-party components. Specify modules that you do or don't want the debugger to automatically load symbols for. Change these settings while you are actively debugging.
I just want to call out the fact that restarting the editor is an important step. I created a tsconfig.json and bashed my head against the wall for a while before I noticed the comment by antfx, and sure enough, restarting VS Code solved the problem.
But in Code, I can't find any editor setting for that.
You need to use tsconfig.json
: https://github.com/TypeStrong/atom-typescript/blob/master/docs/tsconfig.md
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With