Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: support setting loadPath #366

Open
aztack opened this issue Aug 1, 2024 · 1 comment
Open

Feature Request: support setting loadPath #366

aztack opened this issue Aug 1, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Milestone

Comments

@aztack
Copy link

aztack commented Aug 1, 2024

Since some package managers like pnpm do not create node_modules in the root directory of the project, simply replacing "~" in the import url with the workspace path would not work. (see

const workingPath = [workspace.workspaceFolders[i].uri.fsPath, "node_modules"]
).

A brutal yet simple solution would be providing a means to configure the load path in.vscode/settings.json. For example

  "liveSassCompile.settings.loadPaths": [
    "packages/some-package/node_modules"
  ]

And replace "~" with the workspace root path plus all loadPaths and use the first one that exists.

@glenn2223
Copy link
Owner

I was actually about to write a proposal to address the use of ~ - though not for this reason

From dart-sassv1.71, SASS started supporting the pkg: importer when using a specific importer[ref] (not yet implemented in Live SASS)

As long as my understanding is correct, it will allow you to use pkg: instead of ~ and it "could load packages from various different package managers"


I will write the proposal soon (maybe tonight) and reference this issue.

Also good news, I had another idea for CI builds that will be available on VS Code as a pre-release. This means when the change is ready you can start using it almost straight away

@glenn2223 glenn2223 added documentation Improvements or additions to documentation enhancement New feature or request labels Aug 1, 2024
@glenn2223 glenn2223 added this to the v7 milestone Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants