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.

Feature request: "resolve @import only" mode

See original GitHub issue

I think it would be great to have a way to generate a single less file from another set of files. For example, the following:

foo.less

@import "./bar.less";
body { color: my-body-color; }

bar.less

my-body-color: red;

Would give

output.less

my-body-color: red;
body { color: my-body-color; }

Instead of

output.css

body { color: red; }

It would be very useful, together with the !default feature.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Reactions:2
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
rulatircommented, Nov 24, 2017

High on my “regulations that would be 1000× more useful than the cookie law” list: ban parsers that don’t store enough info in the AST to enable character-for-character reconstruction of the input. I hope @import nodes at least store the line number? Looks like something that would be needed for sourcemaps.

1reaction
matthew-deancommented, Feb 1, 2015

It would require the format less feature as a pre-requisite too.

Maybe not. It sounds like it would be an as-is inline dump of the contents of the Less file at the point of @import. BUT my guess is that’s not a trivial change in flow, since currently Less files are fully imported into the AST, and then converted / formatted back out to CSS, if I’m not mistaken. And it sounds like a fairly custom feature. I would think at the least it would be a parse plugin, that takes the contents after import (and before render) and simply allows you to pull out the strings of each file and concatenate them.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Feature Request (As an Editor) - Blackmagic Forum • View topic
But not everything is fix yet. Feature Request: F01 Double click in media-pool to open import window. F02 Import folders from import screen...
Read more >
Feature Request: Options to keep `require.resolve` as external
*.node can't be run only with itself, so I can't use type: ... New import type for externals , like "commonjs-require-resolve" ...
Read more >
Resolve | webpack
Configure how modules are resolved. For example, when calling import 'lodash' in ES2015, the resolve options can change where webpack goes to look...
Read more >
Auto import | IntelliJ IDEA Documentation - JetBrains
Basic procedures to create and optimize imports in IntelliJ IDEA. Learn more how to import the missing import ... Press Alt+Enter to accept...
Read more >
JavaScript modules - MDN Web Docs
Importing features into your script · import { name, draw, reportArea, reportPerimeter } from './modules/square.js'; · /js-examples/module- ...
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