Coder Social home page Coder Social logo

Comments (6)

javierbrea avatar javierbrea commented on June 1, 2024 1

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.

javierbrea avatar javierbrea commented on June 1, 2024 1

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.

javierbrea avatar javierbrea commented on June 1, 2024 1

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.

maico910 avatar maico910 commented on June 1, 2024

@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.

javierbrea avatar javierbrea commented on June 1, 2024

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.

maico910 avatar maico910 commented on June 1, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.