Issue with absolute path for Less files
See original GitHub issueHi all,
I have issues importing a less file into another one from the same folder.
Files:
- components – Home — default.less — page.less
default.less
@import '~antd/lib/style/themes/default.less';
@import (css) url('https://fonts.googleapis.com/css?family=Merriweather:400,700,900');
@font-family: "Merriweather";
@fw-bold: 900;
@site-heading-color: #0d1a26;
@site-text-color: #314659;
...
page.less
@import './default.less';
...
I receive the following error when I run yarn start
Error { [Error: './default.less' wasn't found. Tried - ./default.less,/Users/XXXX/ProjectYY/web/node_modules/antd/lib/style/default.less,/Users/XXXX/ProjectYY/web/src/default.less,default.less]
type: 'File',
filename:
'/Users/XXXX/ProjectYY/web/node_modules/antd/lib/style/themes/default.less',
index: undefined,
line: null,
callLine: NaN,
callExtract: undefined,
column: -1,
extract: [ undefined, undefined, '@import "../color/colors";' ],
message:
'\'./default.less\' wasn\'t found. Tried - ./default.less,/Users/XXXX/ProjectYY/web/node_modules/antd/lib/style/default.less,/Users/XXXX/ProjectYY/web/src/default.less,default.less',
stack: undefined }
I would appreciate your help.
Cheers!
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top Results From Across the Web
Problems resolving relative paths, while compiling less ...
Is there any reason why absolute paths and relative paths should act differently in less options? To me that seems not intuitive and...
Read more >css - lesscss @import with absolute path - Stack Overflow
the import would be relative to the importing file, which is located in the /css folder. So why not import like `@import '../bootstrap/etc/etc', ......
Read more >Using relative paths in LESS files [#3077427] | Drupal.org
I attached my LESS file using *.library.yml. My style uses a relative path to link fonts. After generation CSS by the module, this...
Read more >How to Configure less-loader to Resolve Absolute Import Paths
Provided we have /styles under root, add the following resolve in your webpack config: const path = require('path') module.exports ...
Read more >How to avoid long relative paths import in your angular app
So, you have imported the less directory with the hierarchy, now you can only import the filenames which exist inside the less directory,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
我从头看到尾都没看解决方法
look here https://github.com/ant-design/ant-design-pro/issues/2346