Can't seem to get babel and webpack to work for ES2015, getting import error
<p>My <code>webpack.config.js</code> is this:</p>

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

module.exports = {
  entry: [
    'babel-polyfill',
    './app/main.js'
  ],
  output: {
    path: path.resolve(__dirname, './dist'),
    filename: 'build.js'
  },
  module: {
    loaders: [
      {
        test: '/\.vue$/',
        loader: 'vue'
      },
      {
        test: '/\.js$/',
        loader: 'babel-loader',
        exclude: /node_modules/
      }
    ]
  },
  plugins: [
    new webpack.ExternalsPlugin('commonjs', [
      'electron'
    ])
  ]
}
</code></pre>

<p>my <code>.babelrc</code> is this</p>

<pre><code>{
  "presets": ["es2015"],
  "plugins": ["transform-runtime"]
}
</code></pre>

<p>my <code>./app/main.js</code> is this</p>

<pre><code>import vue from 'vue';
import App from './views/App.vue';

new vue({
  el: 'body',
  components: { App }
});
</code></pre>

<p>my <code>package.json</code> dependencies are this</p>

<pre><code>"dependencies": {
    "babel-polyfill": "^6.16.0",
    "babel-preset-react": "^6.16.0",
    "babel-register": "^6.18.0",
    "babel-runtime": "^5.8.38",
    "jquery": "^3.1.1",
    "vue": "^2.0.3"
  },
  "devDependencies": {
    "babel-cli": "^6.18.0",
    "babel-core": "^6.18.2",
    "babel-loader": "^6.2.7",
    "babel-plugin-transform-runtime": "^6.15.0",
    "babel-preset-es2015": "^6.18.0",
    "babel-preset-stage-0": "^6.16.0",
    "babel-preset-stage-2": "^6.18.0",
    "babel-runtime": "^5.8.38",
    "css-loader": "^0.25.0",
    "electron-prebuilt": "^1.4.5",
    "vue-hot-reload-api": "^2.0.6",
    "vue-html-loader": "^1.2.3",
    "vue-loader": "^9.7.0",
    "vue-style-loader": "^1.0.0",
    "webpack": "^1.13.3",
    "webpack-dev-server": "^1.16.2"
  }
</code></pre>

<p>But when I try to launch my Electron program, I get this error in the console: </p>

<pre><code>Uncaught SyntaxError: Unexpected token import
</code></pre>

<p>Which points to <code>Line 1</code> of <code>./app/main.js</code></p>

<p>I've tried changing the loader to <code>babel</code> instead of <code>babel-loader</code> and I've tried a bunch of different presets, all the links are purple on the first 3 pages of google but most of them point to the same fix usually people forgetting <code>babel-preset-es2015</code> but I have done that. Any help would be great</p>

<p>Running Node Version 6.9.1 and NPM Version 3.10.8</p>

<p><a href="https://i.stack.imgur.com/DPv3N.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DPv3N.png" alt="enter image description here"></a></p>