Make two files instead of three
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- javascript
- Área
- build-system, tooling
Línea de trabajo
Comienza con el comando factor-bundle mostrado en el issue y reprodúcelo usando lib.js, main.js y checkout.js. Traza cómo el comando gestiona los bundles compartidos y de entrada; se considera completado cuando genera los bundles solicitados del sitio y del checkout sin requerir ./main ni producir junk.js.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Hey!
I effectively want to split out part of a file, instead of splitting out the common parts of two files.
Currently I have bundle.js, which contains everything used on the site. There is some checkout specific logic there that I only want on the checkout, so I want to split that stuff out into bundle-checkout.js, but then run both bundle.js and bundle-checkout.js in the checkout.
With factor-bundle by default, I would be running these files on the main site:
- bundle-common.js
- bundle.js
And these on the checkout:
- bundle-common.js
- bundle.js
- bundle-checkout.js
It's pointless for me to have both bundle-common.js and bundle.js!
The best solution I've found so far is to add require('./main') to the top of the input bundle-checkout.js, which would mean that bundle.js is effectively an empty file and I can include bundle-common.js by itself, but then that generates a junk file.
lib.js:
module.exports = 'lib';
main.js:
var lib = require('./lib');
console.log(lib);
checkout.js:
require('./main');
console.log('special checkout logic');
And then the command:
browserify main.js checkout.js -p [ factor-bundle -o junk.js -o bundle-checkout.js ] -o bundle.js
Is there any way to do this without the require('./main') and the useless junk.js file?
Thanks, and sorry for the long question! I'll turn this into an article once it's been figured out so that nobody asks it again :)
- Lenguaje dominante
- JavaScript
- Estrellas
- 397
- Forks
- 24
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de browserify/factor-bundle
-
Dificultad 4/5 3-5 días Aptitud para principiantes 32/100
browserify/factor-bundle#95 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
browserify/factor-bundle#94 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
browserify/factor-bundle#92 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
browserify/factor-bundle#83 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
browserify/factor-bundle#82 · 3 reacciones ·
Todos los issues de browserify/factor-bundle
Issues similares
-
bug confirmed issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
open-webui/open-webui#30750 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Mend: dependency security vulnerability untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100