-
Notifications
You must be signed in to change notification settings - Fork 1.3k
includePaths: ['node_modules'] doesn't work for scoped packages #1596
Comments
What's the result of |
@xzyfer You mean what's inside the scss folder?
|
I got it. I've changed the includePaths value to |
Hmm I'm curious as to why didn't previously work. I'd like to rule out an issue with |
Unfortunately scoped imports don't work with |
@anilanar did it work before v4.5.0? |
@xzyfer Well right now, I'm trying to help our UI people to setup a lerna-based monorepo of stylesheets and I'm pretty confused. Who owns the feature of tilde? Is it I assume So I was talking about tilde, so it's unrelated to |
I have no idea what |
Thanks @XmlmXmlmX. @anilanar as @XmlmXmlmX points out adding |
@xzyfer That is, this problem will not be solved in |
We need some sort of character e.g. |
you can try https://www.npmjs.com/package/node-sass-tilde-importer
I just tested it and it seems to do the job (although I didn't test it with a scoped package) |
It would be good for the Sass language to officially infer that For node, adding a single
Note that this was requested in sass/sass#2350 but was closed with the comment:
This seems to conflict with this issue having the tags |
This cannot be baked into the Sass language. LibSass alone is embedded into
at least 18 different languages,each with their own packaging solution (if
one exists at all).
Additionally ~ is already an overloaded concept meaning the users home
directory.
This belongs in the realm of custom importers. A couple already exist for
your use case. I suggest looking at eyeglass, or sass-loader if you're
using webpack.
…On Wed., 11 Apr. 2018, 11:51 pm Alasdair McLeay, ***@***.***> wrote:
It would be good for the Sass language to infer that ~ means use your
environments package resolution.
For node, adding a single node_modules to your path doesn't account for:
- node_modules that may be in a parent folder (common in monorepo
structures)
- globally installed modules
- when used with npm link
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1596 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAjZWE_3dT0hyXL04Tu85clqt9wwyzyxks5tngpGgaJpZM4I4E98>
.
|
My concern is less about what build system I use, but more about distributing Sass libraries on npm that are dependent on other Sass libraries on npm, independent of what Sass build system the parent project uses to build them. I guess eyeglass may be the solution, though introduces the assumption that the parent project uses node-sass and would use this. Perhaps you could argue that distributing Sass on npm infers that node-sass would be used for the build? |
sass-loader uses the concept that |
I don't see a way this can be integrated into the Sass language. The
language implementation expose hooks to achieve this functionality. I
believe this is the right approach. It enables the right approach and
semantics to come out of the community.
Eyeglass is designed explicitly to solve Sass package via npm. It's fully
aware of npm's import and version conflict resolution semantics.
I encourage you to contribute, or fork that project if need be.
…On Thu., 12 Apr. 2018, 12:07 am Alasdair McLeay, ***@***.***> wrote:
~ is already an overloaded concept
sass-loader uses the concept that ~ without a slash is a lib import
whereas ~/ is the home directory. That seems logical to me but I
understand this introduces a breaking change.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1596 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAjZWAIx7w1ncQGXpjVKFVXFWMeWAj4Zks5tng4JgaJpZM4I4E98>
.
|
source/css/style.scss:
@import "@scope/package-name/scss/style.scss";
Gruntfile.js:
Error when grunt:
When using the same package without scope, it works fine.
The text was updated successfully, but these errors were encountered: