Skip to content

Source-map files from lessc pointing to wrong less file #3567

Closed
ITSecOps-404/aports
#1
@Dvd1234

Description

@Dvd1234

Hey @seven-phases-max @matthew-dean @hirosato @Justineo and everyone in here. :)
This is with regards to lessc. Say, I have three files:-

  1. less0.less (empty)
    (empty)
  2. less1.less
    @import 'less0.less'
  3. less2.less
    @import 'less1.less'
    @var-test: .trial;
    
    @{var-test}{
          color: red;
    }

I am generating Source-map for these files by:-

lessc less2.less less2.css --source-map

The generated CSS files are being used in an html file. Source files are being used for debugging in browser. Now in browser, it shows the .trial class to be in less0.less and not less2.less So, Expected behavior is to have shown less2.less as source for .trial class and not the one being shown:-
https://i.stack.imgur.com/QiNQD.png

That's the less2.css.map file
{"version":3,"sources":["less0.less","less2.less"],"names":[],"mappings":"AAAA;ECKI,wBAAA","file":"less2.css"}

Could anyone please help me out if its an issue or if I need to tweak some setting. Thanks in advance.

USE CASE: Say I have a file with less variables that has my configurations(Say less1.less). I am importing those settings in some other file(Say less2.less). Then, after Source-mapping, when trying to check source from source in dev-tool, it takes me to less1.less and not less2.less.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions