Giter Club home page Giter Club logo

Comments (4)

andyjansson avatar andyjansson commented on May 22, 2024

Added a PR for caching which should also help with performance.

from postcss-import.

jednano avatar jednano commented on May 22, 2024

I have a commit here you can cherry-pick to get started. Unfortunately, that code makes the ignore test fail and I can't yet figure out why. I think I've exhausted my willingness to work on this issue, but feel free to take that commit and do what you will with it.

Also, I noticed the use of fs.existsSync in this plugin's code. I want to point out the fact that this will be deprecated along with the asynchronous version, fs.exists. There's also another comment in the docs that states:

In particular, checking if a file exists before opening it is an anti-pattern that leaves you vulnerable to race conditions: another process may remove the file between the calls to fs.exists() and fs.open(). Just open the file and handle the error when it's not there.

fs.exists() will be deprecated.

Maybe the more graceful solution is to just try opening the files and throw any errors that come up.

from postcss-import.

MoOx avatar MoOx commented on May 22, 2024

6.1.1 has an async option to enable postcss async use, so we might use it to detect async mode and use async fs read. Should not be a big deal from here. Maybe we might use denodeify to transform fs.readFile to a promise.

from postcss-import.

MoOx avatar MoOx commented on May 22, 2024

I guess we can close, right @TrySound ?

from postcss-import.

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.