Babel targets configuration for browser and node builds
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 30/100
- Issue-Typ
- Dokumentation
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- babel, javascript, rollup
- Bereich
- build-system, tooling
Rechercherichtung
Start by reading the undocumented --target CLI flag and the package.json exports question, then reproduce the browser and Node builds with the shown Babel targets. Done means documenting supported configuration guidance for separate outputs and their exports; the issue names no source file or test.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
For a while I have been using the following babel preset for production bundles:
...
"presets": [
[
"@babel/preset-env",
{
"targets": [
"defaults",
"maintained node versions"
]
}
]
],
...
This configuration seems to be incompatible with microbundle as it generates errors such as unknown Statement of type "ForOfStatement" when the source contains for (... of ...) statements. Using "presets": ["@babel/preset-env"] without specifying targets works. However, I am concerned about the compatibility achieved by such "default" builds.
What is the proper way to use microbundle to build for both the browser and for node? What's the correct babel configuration to use? I am fine with having one build for the browser and another for Node, but how should one define package.json exports in that case?
I do realize microbundle probably does the correct thing by default, but I am a bit skeptical given the existence of the --target CLI flag, for which little documentation exists.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 8.1k
- Forks
- 358
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus developit/microbundle
-
CSS
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
developit/microbundle#1002 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
developit/microbundle#789 · 1 Kommentar ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 55/100
developit/microbundle#1100 · 4 Kommentare ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
developit/microbundle#1094 · 1 Kommentar ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
developit/microbundle#1093 · 3 Kommentare · 1 Reaktion ·
Alle Issues in developit/microbundle
Ähnliche Issues
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
Improve Title Support Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
georgestephanis/p2026#40 ·
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Margaret-Petersen/food-delivery-app-clone-react-native#1981 ·