Skip to content

vue-cli使用less出错:This relative module was not found #532

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

Closed
ytftianwen opened this issue Jul 19, 2017 · 1 comment
Closed

vue-cli使用less出错:This relative module was not found #532

ytftianwen opened this issue Jul 19, 2017 · 1 comment

Comments

@ytftianwen
Copy link

ytftianwen commented Jul 19, 2017

项目结构是:

-src

-assets

- components

    -index.js
    -style.less
    -template.html

-router

-App.vue

-main.js

使用vue-cli脚手架,想把.vue单文件改成html+js+less形式进行架构的组建,webpack.base.conf.js中less-loader的配置是:
**{ test: /\.less$/, loader: 'style-loader!css-loader!less-loader' },**
js引入.less文件是:
**import './style.less'**
在使用less时出现了如下问题:
`$ npm run dev

music@1.0.0 dev D:\work\project\demo\music
node build/dev-server.js

Starting dev server...
ERROR Failed to compile with 1 errors16:39:26

This relative module was not found:

  • ./style.less in ./src/components/index.js

Listening at http://localhost:8080
`
请问如何解决

@posva
Copy link
Member

posva commented Jul 19, 2017

Hi, thanks for your interest but Github issues are for bug reports and feature requests only. You can ask questions on the forum, the Discord server, gitter or StackOverflow.


It's telling you the file ./style.less is not there. You may need a different path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants