Problems with browserify

Aperta
#187 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
javascript

Direzione di ricerca

Start by reproducing the Browserify build around the ENVIRONMENT_IS_NODE block and inspect how the require('fs') and require('path') calls are resolved. Define a packaging-compatible way to avoid bundling unused Node.js code, then verify that the browser build succeeds without that code.

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

Descrizione

This kind of environment selectors destroy browserify (code is shortened for brevity).

if (ENVIRONMENT_IS_NODE) {
  var nodeFS = require('fs');
  var nodePath = require('path');

Browserify resolves the require even if it's inside of the if. Because of this, a big piece of Node.js is Browserified and never used because the code never falls there.

This is a nonsense. Is there any simple workaround to solve this problem inside the library?

It's easy to separate the environment selection in two files, one with the browser part and another with the node part but that's not cool for packaging.

What do you think?

Lingua principale
JavaScript
Stelle
13.7k
Fork
1.1k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di sql-js/sql.js

Tutte le issue di sql-js/sql.js

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.