mazipan / vue2-simplert-plugin

⚠️ Vue 2 Simple Alert Plugin (SweetAlert Inspired)
https://mazipan.github.io/vue2-simplert-plugin/
MIT License
30 stars 8 forks source link

Error can't resolve 'Vue' on app building #11

Closed Insolita closed 6 years ago

Insolita commented 6 years ago

Vue version 2.5.13 plugin version 0.1.0 node version 0.9.4 webpack version 5.6.0 os: archlinux ` ERROR in ./node_modules/vue2-simplert-plugin/dist/vue2-simplert-plugin.js Module not found: Error: Can't resolve 'Vue' in '/node_modules/vue2-simplert-plugin/dist' @ ./node_modules/vue2-simplert-plugin/dist/vue2-simplert-plugin.js 2:82-96

This dependency was not found:

To install it, you can run: npm install --save Vue

`

Usage as in documentation

import Vue from 'vue';
...
import Simplert from 'vue2-simplert-plugin';
Vue.use(Simplert);
...
mazipan commented 6 years ago

Can you raise to latest version ?

phelipe commented 6 years ago

Same here.

mazipan commented 6 years ago

Do you have made alias to resolve in webpack

resolve: {
    extensions: ['.js', '.json', '.vue'],
    alias: {
      'vue$': 'vue/dist/vue.esm.js'
    }
  },
phelipe commented 6 years ago

Yes.

mazipan commented 6 years ago

I try using in here and work well

cybermake commented 6 years ago

No build bugs in windows OS... Exception throwed only in linux.

For resolve this problem, add next alias to webpack config:

  'Vue$': 'vue/dist/vue.esm.js',

See my solution:

resolve: { extensions: ['.js', '.vue', '.json'], alias: { 'vue$': 'vue/dist/vue.esm.js', 'Vue$': 'vue/dist/vue.esm.js', '@': resolve('src'), }