From 0f6a16388662ad0a97e01aeb561385082aec7044 Mon Sep 17 00:00:00 2001 From: Adam DeHaven <2229946+adamdehaven@users.noreply.github.com> Date: Thu, 29 Jun 2023 14:20:23 -0400 Subject: [PATCH] fix: exports (#28) --- config.js | 6 +++--- package.json | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/config.js b/config.js index db5d0f2..b44fad3 100644 --- a/config.js +++ b/config.js @@ -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, }, @@ -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, }, diff --git a/package.json b/package.json index 1ea3a37..9ebebc8 100644 --- a/package.json +++ b/package.json @@ -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",