Comments (3)
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.
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.
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)
- Proposal: cache dir instead of src and dest HOT 7
- Update Readme to mention polyfill mode
- Discussion: Automatic directory creation HOT 1
- Discussion: Pre cache
- How to serve static&cached file from different location. HOT 8
- Discussion: Multiple bundles support (Globs?)
- Rollup version is out of date in most recently published version HOT 1
- co? HOT 3
- Cache missed on the second time HOT 2
- Discussion: Option to configure request urls the middleware responds to 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 express-middleware-rollup.