[Question] Sub-exports depending on main export bundle the entire main-export.
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, rollup, typescript
- Ambito
- build-system, tooling
Direzione di ricerca
Inizia con gli esempi index.ts, main.ts e a.ts e analizza come microbundle produce gli output dist/a.* per ogni formato. Controlla prima la configurazione dei sub-export di package.json e la gestione degli external di Rollup. Il lavoro è completato quando i bundle ./a evitano di incorporare main.ts mantenendo al contempo l’import richiesto e l’uso di UMD.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I have a project where I have a main-export and multiple other exports. The other exports are extensions that depend on the main-export, but I don't want them to be in the main-export to keep it as small as possible.
Users should be able to do:
import {Thing} from 'package';
// optional addition
import {OtherThing} from 'package/a';
(or similarly using multiple script-tags with the umd-builds)
As for the source-files, it's roughly like this:
// index.ts
export * from './main';
// main.ts
export class Thing {}
// a.ts
import {Thing} from './main';
export class OtherThing extends Thing {}
And the package.json contains these sub-exports:
"exports": {
".": {
"import": "./dist/index.modern.js",
"require": "./dist/index.js",
"umd": "./dist/index.umd.js",
"browser": "./dist/index.module.js"
},
"./a": {
"import": "./dist/a.modern.js",
"require": "./dist/a.js",
"umd": "./dist/a.umd.js",
"browser": "./dist/a.module.js"
},
}
With this, the output-files for './a' (all formats) have the entire definition of './main.ts' inlined.
So my question is, is there a way to configure microbundle to treat those other files as externals?
- Lingua principale
- JavaScript
- Stelle
- 8.1k
- Fork
- 358
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di developit/microbundle
-
CSS
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
developit/microbundle#1002 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
developit/microbundle#789 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
developit/microbundle#1100 · 4 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
developit/microbundle#1094 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
developit/microbundle#1093 · 3 commenti · 1 reazione ·
Tutte le issue di developit/microbundle
Issue simili
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Improve Title Support Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
georgestephanis/p2026#40 ·
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Margaret-Petersen/food-delivery-app-clone-react-native#1981 ·