@atomico/exports
Facilitates the distribution of webcomponents
GitHub - atomicojs/exports
GitHub
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 }

Installation

NPM
package.json#scripts
1
npm install -D @atomico/exports
Copied!
1
{
2
/**
3
* ⚠️ The --types flag requires the installation of @typescript
4
*/
5
"scripts": "exports src/components/*/*.js --exports --types"
6
}
Copied!

Flags

--exports

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

--types

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

--workspace

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

--ignore-build

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

--watch

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

--minify

Enables minify esbuild code.
Last modified 24d ago