Giter Club home page Giter Club logo

Comments (3)

suluke avatar suluke commented on August 15, 2024

This sounds indeed like a serious issue. I will investigate whether these pseudo-paths are explicitly part of the rollup system

from express-middleware-rollup.

suluke avatar suluke commented on August 15, 2024

I think your idea involving filter is a little too superficial in general. The most robust solution would be to test all the dependencies we got from the rollup bundle if they actually exist - but only AFTER a successful compilation, because failing bundle compilations might be due to a non-existing file. This is how we can make sure that we only consider real file dependencies. One problem with this is that we would always rebuild the bundle on the first load when the dependency cache is still empty (because there hasn't been a successful build yet). We can add a heuristic here to improve this, though, similar to what you have suggested: .filter(id => isValidFileName(id)), where isValidFileName can be arbitrarily complex.
All these considerations aside: The current implementation of allFilesOlder definitely needs to be more robust. We never check if a file exists, only its modification time.

from express-middleware-rollup.

cognitom avatar cognitom commented on August 15, 2024

Agreed. isValidFileName(id) looks reasonable. We could elaborate it in the future, if needed.

I've found path.isAbsolute() is also useful for this purpose.

const isValidFileName = id => path.isAbsolute(id);
const dependencies = bundle.modules
  .map(module => module.id)
  .filter(id => isValidFileName(id));

from express-middleware-rollup.

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.