browserify / static-module

convert module usage to inline expressions
MIT License
74 stars 23 forks source link

Use facebook prepack instead of static-eval #47

Closed dy closed 4 years ago

dy commented 5 years ago

That would allow dynamic paths in require/readFileSync in brfs. Constant propagation is very demanded case

goto-bus-stop commented 5 years ago

supporting more constant propagation would be nice but I'm not sure prepack does the kind of "local" propagation that static-module needs. We'd just need to inline the value of eg. a path passed to fs.readFileSync() but my understanding is that Prepack will partially evaluate the entire module and output a serialized form of that. Is that right?

It sounds like you could maybe run prepack first to inline stuff and then run static-module afterward.