English
Ask or search…
K
Links
Comment on page

@atomico/exports

Improves the export of libraries and components, through the automatic definition of exports, typesVersions and wrappers for your package.json
Atomico export is a solution that parses the output of compilers like vite, esbuild, typescript, rollup or other bundle tool.
Atomico export is also compatible with uncompiled code (standard Javascript).

The objective of Atomico/exports

  1. 1.
    Achieve aesthetic imports at the package level, example:
import { Button } from "components/dist/button.js"; // ❌
import { Button } from "components/button"; // ✅
2. Create wrappers for React/Preact/Vue of webcomponents created with Atomico
import { Button } from "components/button/react";

Installation

NPM
package.json#scripts
npm install -D @atomico/exports
{
/**
* ⚠️ The --types flag requires the installation of @typescript
*/
"scripts": {
"exports": "exports dist/**/* types/**/*"
}
}
@atomico/exports is distributed as ESM, so your package.json must define the property "type":"module" for its use.