Facilitates the distribution of webcomponents
GitHub - atomicojs/exports
Simplify the generation of builds, types and exports by distributing webcomponents in NPM, with @atomico/exports you will be able to:
  1. 1.
    Exporting multiple files using example expressions: exports src/components/*.{js,jsx}.
  2. 2.
    Automatically associate package.json#exports. flag --exports
  3. 3.
    Automatically associate types for typescript package.json # typesVersions. flag --types
  4. 4.
    Optimize build distribution thanks to ESbuild.
  5. 5.
    Import the assets by using import.meta.url, improving the consumption of assets from CDN.
  6. 6.
    Add support for generic Atomico-based CSS modules.
  7. 8.
    Minificar el código. flag --minify.
  8. 9.
    Centralize workspace in a single installation package. flag --workspace <spaces>.
  9. 10.
    Automatically create CSS visibility files for customElements found in export, example my-component:not(:defined){ visibility: hidden }


npm install -D @atomico/exports
* ⚠️ The --types flag requires the installation of @typescript
"scripts": "exports src/components/*/*.js --exports --types"



You will add the build files to the exports property inside the package.json.


It requires the installation of Typescript, it will create the types and add the files to the typesVersion property inside package.json


It will look for the subpackages that declare dependencies and it will add them in the dependencies property of the package.json


Avoid using esbuild, ideal if you have standard js code that you want to distribute without compilation

--meta-url <tipo de archivo>

Add additional support for files not found by default in meta-url export.

--main <nombre>

Of all the exported files, it will associate the one censored with the name of the file as the main one for the export of the package.json

--dest <destino>

Modify the destination directory for the build


Associate the use of watch with esbuild, ignoring the type parsing and exports.


Enables minify esbuild code.
Last modified 24d ago