youzan / vant

A lightweight, customizable Vue UI library for mobile web apps.
https://vant.pro/vant/
MIT License
23.16k stars 9.48k forks source link

通过modifyVars修改less变量,编译报错 #2320

Closed funme closed 5 years ago

funme commented 5 years ago

Describe the bug 想通过modifyVars修改less变量,编译报错

    [
      "import",
      {
        libraryName: "vant",
        libraryDirectory: "es",
        style: name => `${name}/style/less`
      },
      "vant"
    ],
module.exports = {
  css: {
    loaderOptions: {
      less: {
        modifyVars: {
          red: "#03a9f4",
          blue: "#3eaf7c",
          orange: "#f08d49",
          "text-color": "#72add0"
        }
      }
    }
  }
};
@import '../style/var';
@import '@vant/icons/src/index.less';
^
Can't resolve './@vant/icons/src/index.less' in 'f:\projects\xyjz\xyjz_h5\node_modules\vant\es\icon'
      in f:\projects\xyjz\xyjz_h5\node_modules\vant\es\icon\index.less (line 2, column 0)

 @ ./node_modules/vant/es/style/base.less 4:14-194 14:3-18:5 15:22-202
 @ ./node_modules/vant/es/cell/style/less.js
 @ ./src/plugins/vant.js
 @ ./src/plugins/index.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://172.16.8.236:8080/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

Environment

版本降级 1.4.8 不报错

chenjiahan commented 5 years ago

感谢反馈,后续会修复这个问题

chenjiahan commented 5 years ago

已在 1.5.0-beta2 中修复