browserify / browserify/factor-bundle

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

Abierto
#95 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
397
Forks
24
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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?

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Comienza leyendo el comportamiento de bundling de Factor-Bundle y Browserify para los archivos de entrada main.js, sub-app1.js y sub-app2.js, centrándote en cómo se emite common.js. Determina si la salida solicitada puede admitirse sin volver a empaquetar los archivos generados; se considera terminado cuando main.js incluye los requisitos comunes, mientras que los bundles de las subaplicaciones conservan únicamente su código exclusivo.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript
Área
build-system, tooling
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
32/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.