title: Module not found: Error: Can't resolve vue, path not correct
body: <p>I have my webpack.config.js and node_modules in a subfolder. If I trying to execute: <code>npm run build</code> I get the error: <code>ERROR in ../public/Vue/Components/Rating.vue Module not found: Error: Can't resolve 'vue'</code>. I think the path is incorrect, but i trying last 3 hours and i didn't find a solution.</p>
  
  <p>the folder structure looks like:</p>
  
  <pre><code>project/
   +public/
      Vue/
        Components/
           Rating.vue
        main.js
      Dist/
   +webpack/
     webpack.config.js
     package.json
     node_modules/
  </code></pre>
  
  <p>webpack.config.js</p>
  
  <pre><code>var path = require('path');
  var webpack = require('webpack');
  
  var target = '../public/Vue/main.js';
  
  var output = {
      path: path.resolve(__dirname, '../public/Dist/'),
      filename: 'default.js'
  }
  
  
  module.exports = {
    context: __dirname,
    entry: target,
    output: {
      path: output.path,
      filename: output.filename
    },
  
    resolve: {
      alias: {
        'vue$': 'vue/dist/vue.esm.js'
      },
      extensions: ['*', '.js', '.vue', '.json'],
    },
  
  module: {
      rules: [
        ... // load loader
      ]
    },
   ....
  }
  </code></pre>
  
  <p>main.js</p>
  
  <pre><code>import Vue from 'vue';
  import Rating from "./Components/Rating.vue";
  
  new Vue({
    el: '#app',
  
    data() {
      return {
        content: "Hello World",
      }
    },
  
    components: {
      Rating,
    }
  });
  </code></pre>
  
  <p>I hope somebody can me help out :)</p>
  
  <p><strong>Error message</strong></p>
  
  <pre><code>ERROR in ../public/Vue/main.js
  Module not found: Error: Can't resolve 'vue' in 'C:\xampp\htdocs\project\public\Vue'
   @ ../public/Vue/main.js 1:0-22
  
  
  ERROR in ../public/Vue/Components/Rating.vue
  Module not found: Error: Can't resolve 'vue-style-loader' in 'C:\xampp\htdocs\project\public\Vue\Components'
   @ ../public/Vue/Components/Rating.vue 2:2-297
   @ ../public/Vue/main.js
  </code></pre>