Skip to content

@import directive in *.less files resolves to the wrong package #93

@jluxenberg

Description

@jluxenberg

Context

Consider two packages "project-a" and "project-b".

"project-a" depends on "dependency-a" v1.0.0
"project-b" depends on "dependency-a" v2.0.0

Both projects import a file "style.less" from "dependency-a".

"project-a" should get v1.0.0 of "style.less"
"project-b" should get v2.0.0 of "style.less"

However, if you import "style.less" via an @import directive, both projects get v1.0.0 of the dependency.

Here's a reproduction of the issue:
2023-05-30_esbuild-plugin-less-bug.tgz

Expected Behavior

In my example: "project-b" has background color green (corresponding to version v2.0.0 of the dependency) in the CSS file produced.

Actual Behavior

"project-b" has background color red (corresponding to version v1.0.0 of the dependency) in the CSS file produced.

Steps to Reproduce the Problem

  1. Download above tarball
  2. run yarn install
  3. run yarn test
  4. see this:
    CleanShot 2023-05-30 at 16 19 40

Versions

  • esbuild: 0.17.19
  • esbuild-plugin-less: 1.2.0
  • Platform: MacOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions