question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[2.0] How do you import relative less files?

See original GitHub issue

Versions:

    "umi": "^2.0.1",
    "umi-plugin-react": "^1.0.1"

I’ve looked at #2346 and #2432 and #2306 and it still doesn’t work.

I’m importing from:

app/src/components/Foo/Bar/index.less

I’m trying to import:

app/src/variables.less

I’ve tried:

@import '../../../variables.less'; @import '/variables.less'; @import '/src/variables.less'; @import '~/variables.less'; @import '~variables.less'; @import '~@/variables.less'; @import '~@variables.less';

I also tried to change the varFile in https://github.com/ant-design/ant-design-pro/blob/master/config/plugin.config.js to the ../src/variables.less and that didn’t work either.

Nothing works. How do I fix this?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
codesignistcommented, Nov 8, 2018

Then why do we use plugin.config.js file. Let’s remove it permanently.

2reactions
Newbit13commented, Feb 23, 2021

sorry,this is my error. you can remove plugin.config.js

work

Read more comments on GitHub >

github_iconTop Results From Across the Web

LESS importing CSS and relative paths - Stack Overflow
css has a relative path to images as "../img" so when I minify all these files and dump my output file, it no...
Read more >
Command Line Usage - Less CSS
This option allows you to rewrite URLs in imported files so that the URL is always relative to the base file that has...
Read more >
Using relative paths in LESS files [#3077427] | Drupal.org
My style uses a relative path to link fonts. ... The url root to prepend to any relative image or @import urls in...
Read more >
Issue with absolute path for Less files #2306 - GitHub
Hi all, I have issues importing a less file into another one from the same folder. ... [2.0] How do you import relative...
Read more >
LESS - Quick Guide - Tutorialspoint
Open this HTML file in a browser, the following output will get displayed. Less Importing. LESS - Variables. In this chapter, we will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found