Skip to content

Commit

Permalink
fix: exports (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdehaven authored Jun 29, 2023
1 parent e30a5a5 commit 0f6a163
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,14 @@ platforms.javascript = {
// JavaScript ES constants
{
format: 'javascript/es6',
destination: 'index.js',
destination: 'index.mjs',
// Exclude alias tokens and asset tokens compiled in a separate file
filter: (token) => token.isSource === true && token.attributes.category !== 'asset',
},
// Constants TypeScript types
{
format: 'typescript/es6-declarations',
destination: 'index.d.ts',
destination: 'index.d.mts',
options: {
outputStringLiterals: true,
},
Expand All @@ -175,7 +175,7 @@ platforms.javascript = {
// CommonJS types
{
format: 'typescript/module-declarations',
destination: 'cjs/index.d.ts',
destination: 'cjs/index.d.cts',
options: {
outputStringLiterals: true,
},
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,18 @@
"files": [
"dist"
],
"main": "dist/tokens/js/cjs/index.cjs",
"module": "dist/tokens/js/index.mjs",
"types": "dist/tokens/js/index.d.ts",
"exports": {
".": {
"import": {
"default": "./dist/tokens/js/index.js",
"types": "./dist/tokens/js/index.d.ts"
"default": "./dist/tokens/js/index.mjs",
"types": "./dist/tokens/js/index.d.mts"
},
"require": {
"default": "./dist/tokens/js/cjs/index.cjs",
"types": "./dist/tokens/js/cjs/index.d.ts"
"types": "./dist/tokens/js/cjs/index.d.cts"
}
},
"./package.json": "./package.json",
Expand Down

0 comments on commit 0f6a163

Please sign in to comment.