vueComponent / ant-design-vue

🌈 An enterprise-class UI components based on Ant Design and Vue. 🐜
https://antdv.com/
Other
20.34k stars 3.8k forks source link

less引用方式报错 #68

Closed liuqz closed 6 years ago

liuqz commented 6 years ago

Version

0.7.0

Environment

archlinux X64, chromium 67, Vue 2.5.16, less 3.0.4, less-loader 4.1.0

Reproduction link

http://localhost:8080

Steps to reproduce

import Antd from 'vue-antd-ui'
import 'vue-antd-ui/dist/antd.less'

yarn serve 就报错

ERROR  Failed to compile with 1 errors                                                                                                                                              9:12:43 PM

error  in ./node_modules/vue-antd-ui/dist/antd.less

Module build failed (from ./node_modules/less-loader/dist/cjs.js):

// https://github.com/ant-design/ant-motion/issues/44
.bezierEasingMixin();
^

What is expected?

引用less文件,覆写样式

What is actually happening?

引用就报错

tangjinzhou commented 6 years ago

less-loader添加 {javascriptEnabled: true}

tangjinzhou commented 6 years ago

更多可参考 https://github.com/ant-design/ant-design/issues/7927

liuqz commented 6 years ago

@vue/cli 3.0创建的项目,增加less-loader仍然不起作用,依然报错 vue.config.js

module.export = {
    productionSourceMap: false,
    css: {
        loaderOptions: {
            less: {
                javascriptEnabled: true
            }
        }
    }
}

增加这个文件后,还是报上面那个错误

tangjinzhou commented 6 years ago

如何修改Ant Design of Vue主题色? - 择卡的回答 - 知乎 https://www.zhihu.com/question/284811056/answer/440370119

liuqz commented 6 years ago

你这个回答是针对vue-cli 2.X的,vue-cli 3.x的配置文件变了,没有build/utils.js这个目录的配置了,只能通过vue.config.js或package.json配置。

liuqz commented 6 years ago

是我错了,module.exports少写了个s。谢谢!

XINXINP commented 5 years ago

1.在vue.config.js文件里配置 module.export = { css: { loaderOptions: { less: { javascriptEnabled: true } } } } 2.降低vue-cli 版本号

github-actions[bot] commented 4 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.