didi / cube-ui

:large_orange_diamond: A fantastic mobile ui lib implement by Vue
https://didi.github.io/cube-ui/
Apache License 2.0
9.14k stars 1.47k forks source link

vue.config.js增加了resolve .modules配置后引入报错 #737

Closed w2819 closed 4 years ago

w2819 commented 4 years ago

vue.config.js增加了如下配置


const path = require('path');

function resolve(dir) {
  return path.join(__dirname, './', dir);
}

configureWebpack: (config) => {
    // eslint-disable-next-line no-param-reassign
    config.resolve = {
      extensions: ['.js', '.vue', '.json'],
      modules: [
        resolve('src'),
        resolve('node_modules'),
      ],
    };
  },

后项目启动会报vue.runtime.esm.js?2b0e:5106 Uncaught TypeError: Cannot read property 'install' of undefined这个错误,无法启动

vue@^2.6.11 @vue/cli 4.5.8

w2819 commented 4 years ago

引入文件命名跟模块命名重名导致的···