Single-factory, flattened versions of the per-format coverage bundles, committed as generated build output under dist/. Generated by tools/generate-bundles.mjs (driving @awacloud/tool-prebuild-generator) — do not edit the output files by hand. Re-run via:
bun run gen:bundles
Each logical bundle (docx / docx-large / docx-full and the same for xlsx / pptx) ships in two surfaces:
| Surface | Files | dependencies |
Use when |
|---|---|---|---|
dist/standalone/<root>.{js,min.js,meta.json} (-bundled) |
e.g. docx.js, docx.min.js, docx.meta.json |
[] |
You want a single self-contained factory — every fw and ooxml-local module is inlined. Zero runtime registration. Largest file size. |
dist/build/<root>.{js,min.js,meta.json} (-package) |
e.g. docx.js, docx.min.js, docx.meta.json |
the fwDependencies of its meta.json (xml, bitstream, huffman, lz77, deflate, zip, crc32) |
You already have an fw ModuleRuntime with those fw modules registered (fw_require of @awacloud/ooxml is exactly that list). The bundle factory receives the fw instances by DI, inlines every ooxml-local factory itself. Smallest payload. |
dist/build/ additionally ships an index.js barrel that re-exports the whole src/main.js namespace (the fw_require/modules/extras/bundle arrays plus every individual module descriptor by binding name) — see dist/build/index.js.
Resolve keys
| Bundle | Bundled | Package |
|---|---|---|
| docx | docxBundled |
docxPackage |
| docx-large | docxLargeBundled |
docxLargePackage |
| docx-full | docxFullBundled |
docxFullPackage |
| xlsx | xlsxBundled |
xlsxPackage |
| xlsx-large | xlsxLargeBundled |
xlsxLargePackage |
| xlsx-full | xlsxFullBundled |
xlsxFullPackage |
| pptx | pptxBundled |
pptxPackage |
| pptx-large | pptxLargeBundled |
pptxLargePackage |
| pptx-full | pptxFullBundled |
pptxFullPackage |
Usage — dist/standalone (-bundled)
Direct factory call, no DI needed:
import { docxLargeBundled } from '@awacloud/ooxml/standalone/docx-large.js';
const docx = docxLargeBundled.factory();
const result = docx.read(bytes);
Or via a runtime (the descriptor declares no dependencies, so registration is trivial):
import { ModuleRuntime } from '@awacloud/fw/core/runtime.js';
import { docxLargeBundled } from '@awacloud/ooxml/standalone/docx-large.js';
const rt = new ModuleRuntime();
rt.register(docxLargeBundled);
const docx = rt.resolve('docxLargeBundled');
Usage — dist/build (-package)
The factory takes the fw modules of fwDependencies positionally. With a runtime, register them through fw_require:
import { ModuleRuntime } from '@awacloud/fw/core/runtime.js';
import { fw_require } from '@awacloud/ooxml';
import { docxLargePackage } from '@awacloud/ooxml/build/docx-large.js';
const rt = new ModuleRuntime();
rt.registerAll(fw_require); // xml, bitstream, huffman, lz77, deflate, zip, crc32
rt.register(docxLargePackage);
const docx = rt.resolve('docxLargePackage');
Notes
- The pre-built descriptors coexist with the legacy declarative ones (
docxLargeBundle, etc.). Pick whichever fits your wiring style. - Surface returned by the factory is the same
docx/xlsx/pptxinstance the legacy bundles return —read,write,use, plus all the typed extras layered viacore.use(...). - The 18 committed descriptors (9 roots × 2 surfaces) under
dist/build/anddist/standalone/carry the header/* GENERATED — do not edit */. Modifytools/generate-bundles.mjsinstead.