Comments (6)
I @maico910,
I understand the problem, but I think that moving the dependency to optionalDependencies
would solve it, but I'm not sure if it would be right, because I think that the purpose of the optionalDependencies
property is not exactly that.
Which is the problem exactly? Are you using this package with other package different to node-sass
which is not deprecated? Are you using another node-sass
version that is not supported by this package?
Maybe the best solution would be to remove the node-sass
dependency at all, but then, how could the package say "I'm tested to be compatible with those versions of node-sass"?
Thanks for your feedback, and please let me think about a solution, because of course this is something that should be fixed.
from node-sass-alias-importer.
After reading deeper the NPM documentation at this respect, it seems that the solution could be to add a peerDependenciesMeta
property indicating that the peerDependency
is optional. I'll make some tests and publish a new release as soon as possible if it works as I expect.
from node-sass-alias-importer.
Hi again @maico910. Then, it seems that it doesn't work with sass
. It is completely normal, because this plugin was designed to work with node-sass
. I thought that the problem was related only to the plugin dependencies.
I'll close this issue, because its name indicates that it is a dependencies problem, that has been already solved (thanks for making me discover the peerDependenciesMeta
property, which I didn't know about).
Anyway, if you are interested in making this plugin work with sass
, feel free to open another issue, and we can discuss the topic there.
Note also that, if you are using Webpack, I think that you can use its resolve.alias
option directly, and then sass-loader
recognizes it, so you should be able to import your aliases as in @import "myAlias/x"
or @import "~myAlias/x"
without using any other extra plugin.
from node-sass-alias-importer.
@javierbrea
Maybe I have some misunderstanding about the project, the project was maded for node-sass
and not sass
(dart-sass) itself, so maybe I'm using it the way it wasn't planned
My problem is actually I'm using sass
, and when I try to build the compiler is trying to use node-sass
instead of sass
, and I'm getting error for missing dependencies to compile for node-sass
, and I think these dependecies It's not more necessary for sass
. And now I'm using npm@8
(npm > 7), It's default installing peer dependencies with dependencies, so I'll have problem with CI/CD
thanks, for the reply
from node-sass-alias-importer.
Don't worry @maico910, I'm glad to hear that it works also with sass
I have to add some E2E tests to the project, and I will also test it with sass
. If it also works properly, I'll update the docs to specify it, and I will also add sass
to peerDependencies
(marked as "optional" as well).
But, first of all, please let me know if you are still facing the issue with version 1.2.0
from node-sass-alias-importer.
Now I'm receiving error about can't resolve import to node_modules
with sass-loader
's default webpack alias:
The sass-loader uses Sass's custom importer feature to pass all queries to the Webpack resolving engine. Thus you can import your Sass modules from node_modules.
@import "bootstrap";
(...) The loader will first try to resolve
@import
as a relative path. If it cannot be resolved, then the loader will try to resolve@import
inside node_modules.
more information from here
In this case, I don't know if is worth it to make library work on node-sass
and sass
simultaneously.
I will check which case work or doesn't work:
-
@import ~bootstrap
-
@import bootstrap
-
@import node_modules/bootstrap
from node-sass-alias-importer.
Related Issues (11)
- First release
- Dependency Dashboard
- Add windows support. HOT 1
- Add Rollup and Webpack E2E tests
- Add alternatives to documentation
- Add mutation tests
- Link to LICENSE file is broken
- Support ~ as default alias
- Bump node version to 16 / 17 HOT 5
- "Error: done is not a function" in sync render sass mode HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-sass-alias-importer.