Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

按需引入 Menu 在使用 css 会提示 Failed to resolve loader: less-loader #3678

Closed
1 task done
crazyhl opened this issue Feb 17, 2021 · 8 comments
Closed
1 task done

Comments

@crazyhl
Copy link

crazyhl commented Feb 17, 2021

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

2.0.0

Environment

maxos 、 chrome88 、 vue3

Reproduction link

Edit on CodeSandbox

Steps to reproduce

import 'ant-design-vue/lib/menu/style/css';

What is expected?

使用 css 的时候不会使用 less

What is actually happening?

Failed to resolve loader: less-loader You may need to install it.
image


我在看代码的时候发现是文件 ant-design-vue/lib/menu/style/css 中 第七行

require("../../tooltip/style");

此行引起的问题,改写为

require("../../tooltip/style/index.css");

就不会报错了
image

@sendya
Copy link
Member

sendya commented Feb 17, 2021

请安装 less, less-loader

@sendya
Copy link
Member

sendya commented Feb 17, 2021

如需按需引入,直接 import { Menu } from 'ant-design-vue' 即可

@crazyhl
Copy link
Author

crazyhl commented Feb 17, 2021

请安装 less, less-loader

如果决定使用了 css 的话,为什么还要安装 less 呢?
如果选择 less 直接就用 less 就好了

zkwolf added a commit to zkwolf/ant-design-vue that referenced this issue Feb 17, 2021
@zkwolf
Copy link
Member

zkwolf commented Feb 17, 2021

下个版本会修复

@zkwolf zkwolf closed this as completed Feb 17, 2021
@crazyhl
Copy link
Author

crazyhl commented Feb 18, 2021

下个版本会修复

thx

@ethan666
Copy link

ethan666 commented Sep 26, 2021

我用vue-cli创建项目。最终环境
QQ截图20210926090121

不知道应该装什么版本的less-loader。
装最新的提示this.getOptions is not a function。 应该是webpack版本(我的是4.46.0)跟less-loader新版本不兼容.
装旧的提示
// https://github.com/ant-design/ant-motion/issues/44 .bezierEasingMixin(); ^ Inline JavaScript is not enabled. Is it set in your options? in D:\workspace\learning\home-website\node_modules\ant-design-vue\es\style\color\bezierEasing.less (line 110, column 0)

@sendya @zkwolf

@ethan666
Copy link

ethan666 commented Sep 26, 2021

是不是要装vue-cli的下个版本?
npm install -g @vue/cli@next

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants