browserify / browserify/browserify

How to supply all files as an object?

Open
#1,157 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
14.7k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

I have all my files in memory, for various reasons I won't get into ( maybe one is because I wrote a loading module `loaddir` and tend to use it ), but part of it is re-using code on the front end and back end.

My loaded files look like this (`asObject: true`):

```
require('loaddir')({path: './scripts', asObject: true }).then(function(directory) {
/* directory == {
'file1': 'console.log("file1");',
'subDirectory': {
'file2': 'console.log("subDir/file2");',
},
} */
});
```

or, my loaded files look like this (`asObject: false`)

```
require('loaddir')({path: './scripts' }).then(function(directory) {
/* directory == {
'file1': 'console.log("file1");',
'subDirectory/file2': 'console.log("subDir/file2");',
} */
});
```

How do I give a manifest like this to browserify, telling it "Hey browserify, I already loaded everything, can you just compile using this data plz?"

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.