Stream Non-Entry Files
See original GitHub issueI’m trying to also stream files that the entry file requires is this possible? I have been looking for a while and haven’t found innate to browserify or a plugin.
Simplified Example:
const str = require('string-to-stream');
const browserify = require('browserify');
const entry = "const func = require('./func.js')";
const func = "module.exports = function() {return 'func'}";
browserify(str(entry), {basedir: __dirname})
// somehow map './func.js' to func string
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
File Streams (Local File Systems) - Win32 apps - Microsoft Learn
A stream is a sequence of bytes. In the NTFS file system, streams contain the data that is written to a file, and...
Read more >TypeStrong/tsify: Browserify plugin for compiling TypeScript
2.0.7 - Tracked files for filtered stream and module-name 'rows'. ... 0.11.13 - Fixed bug introduced in last change where non-entry point files...
Read more >yarb - UNPKG
This allows passing in existing buffers/streams by just wrapping them in vinyl objects beforehand. ... 40, Adds non-entry files to be included in...
Read more >ELD List - ELD - Electronic Logging Devices
Transfer via Bluetooth - this option enables the user to transfer files through Bluetooth. The ELD prompts for an output file comment which...
Read more >Confined Space Post-test answer key
Non entry rescue c. Entry rescue d. All of the above. 4. a permit-required confined space has one or more of these characteristics....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am doing some similar things in my tools, generating source on the fly in response to certain require statements. If you are OK with requiring a module name like
'foo-bar'
rather than relative path, you can do this:If you need relative file names like
./foo-bar.js
, you may have to dive into plugins, potentially doing something like altering the.source
property as rows come through the pipeline, if the id matches the file you are trying to modify.NOTE: These things can cause issues with watchify since there is no file on disk to invalidate the cache; so you can’t really have a dynamic stream that changes over the course of development. At some point I hope watchify or browserify API will introduce some method of invalidating a resource by file ID or something, to fix this pitfall.
Repo for plugin require_stringify