title: node-ts shows "error TS2304: Cannot find name '__DEV__'"
body: <p>I recently added <code>__DEV__</code> to some TypeScript file in my NodeJS project. In VSCode, this is not marked as an error.</p>
  <p>However, when I run the project, I immediately get the error</p>
  <pre><code>error TS2304: Cannot find name '__DEV__'.
  </code></pre>
  <p>I tried adding <code>/* global __DEV__ */</code> to the top of the file. Error still there.</p>
  <p>I tried adding a <code>global.d.ts</code> file where I <code>declare var __DEV__: boolean;</code>. Error still there.</p>
  <p>Here's my tsconfig:</p>
  <pre><code>{
   &quot;compilerOptions&quot;: {
    &quot;target&quot;: &quot;es6&quot;,
    &quot;lib&quot;: [
     &quot;es2017&quot;,&quot;es2015&quot;,&quot;dom&quot;,&quot;es6&quot;
    ],
    &quot;module&quot;: &quot;commonjs&quot;,
    &quot;outDir&quot;: &quot;./&quot;,
    &quot;sourceMap&quot;: true,
    &quot;esModuleInterop&quot;: true,
    &quot;strict&quot;: false,
    &quot;resolveJsonModule&quot;: true,
    &quot;downlevelIteration&quot;: true
   },
   &quot;include&quot;: [
    &quot;**.ts&quot;
   ],
   &quot;exclude&quot;: [
    &quot;node_modules&quot;
   ]
  }
  </code></pre>
  <p><strong>EDIT:</strong> The project is launched via a <code>launch.json</code> file in VSCode. Here's its contents:</p>
  <pre><code>{
      &quot;version&quot;: &quot;0.2.0&quot;,
      &quot;configurations&quot;: [
          {
              &quot;name&quot;: &quot;Current TS File&quot;,
              &quot;type&quot;: &quot;node&quot;,
              &quot;request&quot;: &quot;launch&quot;,
              &quot;args&quot;: [&quot;${relativeFile}&quot;],
              &quot;runtimeArgs&quot;: [&quot;--nolazy&quot;, &quot;-r&quot;, &quot;ts-node/register&quot;, &quot;--max-old-space-size=32768&quot;],
              &quot;cwd&quot;: &quot;${workspaceRoot}&quot;,
              &quot;protocol&quot;: &quot;inspector&quot;,
              &quot;internalConsoleOptions&quot;: &quot;openOnSessionStart&quot;,
              &quot;console&quot;: &quot;integratedTerminal&quot;,
              &quot;stopOnEntry&quot;: false,
              &quot;skipFiles&quot;: [
                  &quot;${workspaceFolder}/node_modules/**/*.js&quot;,
                  &quot;&lt;node_internals/**/*.js&quot;
              ]
          }
      ]
  }
  </code></pre>