I have my webpack.config.js and node_modules in a subfolder. If I trying to execute: npm run build I get the error: ERROR in ../public/Vue/Components/Rating.vue Module not found: Error: Can't resolve 'vue'. I think the path is incorrect, but i trying last 3 hours and i didn't find a solution.
the folder structure looks like:
project/
 +public/
    Vue/
      Components/
         Rating.vue
      main.js
    Dist/
 +webpack/
   webpack.config.js
   package.json
   node_modules/
webpack.config.js
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
    ]
  },
 ....
}
main.js
import Vue from 'vue';
import Rating from "./Components/Rating.vue";
new Vue({
  el: '#app',
  data() {
    return {
      content: "Hello World",
    }
  },
  components: {
    Rating,
  }
});
I hope somebody can me help out :)
Error message
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
 
     
    