browserify / browserify/factor-bundle

Any way to apply the `common.js` to one of the entry files?

Aperta
#95 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
397
Fork
24
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I'm using Factor-Bundle with Browserify to generate multiple partial bundles and a larger `common.js` file with all of the common requirements. However, one of the partial bundles corresponds to my main entrypoint, `main.js` which I would actually like to contain all of `common.js` so that I have one main file with all the common JS *and* the main contents of my app, and then the other partial bundles correspond to sub-apps.

To clarify, I am trying to go from these entry points:
- `main.js`
- `sub-app1.js`
- `sub-app2.js`

to this:

- `main.js` (INCLUDING ALL COMMON REQUIREMENTS)
- `sub-app1.js` (only code and require()s unique to sub-app1)
- `sub-app2.js` (only code and require()s unique to sub-app2)

But Factor-Bundle gives me:

- `common.js` // <- can I merge this with main.js somehow???
- `main.js`
- `sub-app1.js` //good
- `sub-app2.js` //good

Unless there's some hidden option in Browserify or Factor-Bundle to generate them how I want, my next guess is there might be some Browserify function that would simply let me merge two generated packages back into one? I can't simply `browserify.bundle(common.js, main.js)` after the fact because those bundled files are in different locations and I get errors that it can't locate the relative file paths anymore.

Any ideas?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia leggendo il comportamento di bundling di Factor-Bundle e Browserify per i file di ingresso main.js, sub-app1.js e sub-app2.js, concentrandoti su come viene emesso common.js. Determina se l’output richiesto può essere supportato senza eseguire nuovamente il bundling dei file generati; l’attività è completata quando main.js include i requirements comuni, mentre i bundle delle sotto-applicazioni conservano solo il loro codice esclusivo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript
Ambito
build-system, tooling
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
32/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.