1

I import less in main.js but webpack compile failed.I dont understand this error message. I thought it is about path problem and tried both absolute path and relative path,but it does not work.

Here is Error message:

 ERROR  Failed to compile with 1 errors                                                      14:35:04

 error  in ./src/assets/style/index.less

Module build failed:

// load the styles
var content = require("!!../../../node_modules/css-loader/index.js?{\"minimize\":false,\"sourceMap\":
false}!../../../node_modules/less-loader/dist/cjs.js?{\"sourceMap\":false}!./index.less");
          ^
Unrecognised input
      in /Users/yungcho/myWork/vo_reconstraction_front/src/assets/style/index.less (line 4, column 12)

 @ ./src/assets/style/index.less 4:14-285 18:2-22:4 19:20-291
 @ ./src/main.js
 @ multi ./build/dev-client ./src/main.js

Here is index.less

@import './variable.less';
@import './base.less';

webpack.base.conf.js

{
   test: /\.less/,
   use: [
      'style-loader',
      'css-loader',
      'less-loader'
    ]
}

I'm appreciate if you can give me some suggestion

1 Answer 1

1

I have solved this question. I use vue-cli and it has been configured for less support.If there is twice setting in webpack to one plugins,this error will be throwed.so you just to install less && less-loader

npm i less less-loader -D
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.