Git Product home page Git Product logo

Comments (5)

JohnAlbin avatar JohnAlbin commented on June 14, 2024

In node-sass 3.4, the "prev" argument is the “the path in import as-is, which libsass encountered”. If the "prev" file was not @import'ed and just loaded into node-sass, then the "prev" argument is the full path to the file.

It looks like node-sass-import-once is only looking at the prev argument when it is a full path. But that is wrong. If the "prev" import was "folder/file", it needs to look in the "folder" where it found "file".

I just tested Ruby Sass and when it encounters an @import "somefile"; it looks for the "somefile" in this order:

  1. The same directory of the file that had the @import.
  2. The project root (if Sass was pointed at a directory to render)
  3. Import paths

It looks like node-sass is taking care that 2 is added to the top of the import paths. And while node-sass correctly does 1, node-sass-import-once is ignoring 1.

from node-sass-import-once.

JohnAlbin avatar JohnAlbin commented on June 14, 2024

Some of this will be fixed with sass/node-sass#1220 , maybe? Can't test until the bindings are rebuilt with the new node-sass 3.4.2 release.

from node-sass-import-once.

Snugug avatar Snugug commented on June 14, 2024

I'm betting this is the same issue as a lot of this code comes from work Chris has done for Eyeglass and if it's broken for him, it's broken for me. Let's see what 3.4.2 brings

from node-sass-import-once.

yoannisj avatar yoannisj commented on June 14, 2024

Apparently, in eyeglass this was fixed with the new release of node-sass-3.4.2: sass-eyeglass/eyeglass#73

Might be just a matter of updating the node-sass dependency to 3.4.2

from node-sass-import-once.

JohnAlbin avatar JohnAlbin commented on June 14, 2024

Might be just a matter of updating the node-sass dependency to 3.4.2

No need. The current package.json has "node-sass": "^3.0.0-beta.5" so it will pick up the latest 3.x version of node-sass.

It looks like node-sass-import-once works again now that node-sass 3.4.2 is out.

However, node-sass-import-once tests still need to be fixed as node-sass' compilation has changed slightly. I already opened #19 to fix them.

from node-sass-import-once.

Related Issues (20)

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.