H5W3
当前位置:H5W3 > JavaScript > Vue相关 > 正文

vue Failed to compile with 2 errors:dependencies were not found

vue引入文件报错:Failed to compile with 2 errors:dependencies were not found



回答

vue-cli中alias没有~,css中可以使用~@指向设置的alias

// vue.config.js
const path = require('path');

module.exports = {
  configureWebpack: {
    resolve: {
      alias: {
        '@lib': path.join(__dirname, 'lib'),
      },
    },
  },
};

// app.js
import '@lib/form-xxxx';

本文地址:H5W3 » vue Failed to compile with 2 errors:dependencies were not found

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址