Electron and typescript "Cannot find module 'electron'" : <p>Regarding <a href="https://electron.atom.io/blog/2017/06/01/typescript" rel="noreferrer">https://electron.atom.io/blog/2017/06/01/typescript</a>
electron support typescript but is not working on my setup:</p>

<p><a href="https://i.stack.imgur.com/Zhoev.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/Zhoev.jpg" alt="[ts] cannot find module &#39;electron&#39;"></a></p>

<p>I use vscode 1.16.1</p>

<p>Here is my package.json</p>

<pre><code>{
  [...]
  "devDependencies": {
    "electron": "^1.6.13",
    "ts-loader": "~2.3.7",
    "typescript": "~2.5.0",
    "webpack": "^3.6.0",
    [...]
  }
}
</code></pre>

<p>tsconfig.json</p>

<pre><code>{
    "compilerOptions": {
        "module": "es6",
        "noImplicitAny": true,
        "removeComments": true,
        "preserveConstEnums": true,
        "sourceMap": true
    },
    "include": [
        "src/**/*"
    ]
}
</code></pre>

<p>and my webpack</p>

<pre><code>const path = require('path');

module.exports = [{
  entry: './src/main.ts',
  devtool: 'inline-source-map',
  target: 'electron',
  module: {
    rules: [
      { test: /\.ts$/, use: 'ts-loader', exclude: /node_modules/ }
    ]
  },
  node: {
    __dirname: false,
    __filename: false
  },
  resolve: {
    extensions: [".ts", ".js"]
  },
  output: {
    filename: 'electron_core.js',
    path: path.resolve(__dirname, 'dist')
  }
}  
];
</code></pre>

<p>When I add at the top of my main.ts</p>

<pre><code>///&lt;reference path="../node_modules/electron/electron.d.ts" /&gt;
</code></pre>

<p>then is ok I don't have the error anymore. However I would like to avoid referencing files like this as it seems it's useless with the latest version of typescript (see <a href="https://stackoverflow.com/questions/12930049/how-do-i-import-other-typescript-files?answertab=votes#tab-top">How do I import other TypeScript files?</a>) and moreover in the electron tutorial for typescript they don't need it ...)</p>

<p>Thanks</p>
