less / less/less.js

When using --source-map assets in `../` are getting full paths

Open
#1,741 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug medium priority
Dominant language
JavaScript
Stars
17k
Forks
3.4k
Avg merge
7h 42m
Merged PRs (30d)
26

Description

So I'm using --source-map and no matter what I do for basepath or rootpath if I have an asset imported via ../sibling/whatever.css it instead outputs the full path in the map:

so
../components/bootstrap/less/normalize.less
becomes
/Users/Dean/Sites/paxata/frontend/src/main/webapp/components/bootstrap/less/normalize.less

in my map file. I have 0 idea how to fix this. This is my command I'm using:

lessc -ru -x --source-map style/paxata.less style/paxata.min.css

where some libraries are located in /components (bower components) and others are located inside /style

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the shown lessc command, --source-map, and an asset imported through ../sibling/whatever.css. Inspect how source-map paths are generated for assets in /components and /style; done means the map preserves usable relative paths instead of exposing the full local filesystem path.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
build-system, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.