Babel targets configuration for browser and node builds
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 30/100
- Tipo de issue
- Documentação
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- babel, javascript, rollup
- Domínio
- build-system, tooling
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- JavaScript
- Estrelas
- 8.1k
- Forks
- 358
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de developit/microbundle
-
CSS
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
developit/microbundle#1002 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
developit/microbundle#789 · 1 comentário ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
developit/microbundle#1100 · 4 comentários ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
developit/microbundle#1094 · 1 comentário ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 45/100
developit/microbundle#1093 · 3 comentários · 1 reação ·
Todas as issues de developit/microbundle
Issues semelhantes
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
Improve Title Support Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
georgestephanis/p2026#40 ·
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
Margaret-Petersen/food-delivery-app-clone-react-native#1981 ·