diff --git a/.gitignore b/.gitignore index c2658d7..1eae0cf 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ +dist/ node_modules/ diff --git a/esbuild.js b/esbuild.js new file mode 100644 index 0000000..7d14d1e --- /dev/null +++ b/esbuild.js @@ -0,0 +1,15 @@ +const esbuild = require('esbuild'); + +const buildCJS = esbuild.build({ + entryPoints: ['./index.js'], + outfile: './dist/index.cjs', + format: 'cjs' +}) + +const buildESM = esbuild.build({ + entryPoints: ['./index.js'], + outfile: './dist/index.mjs', + format: 'esm' +}) + +Promise.all([buildCJS, buildESM]).catch(() => process.exit(1)) diff --git a/package.json b/package.json index 5329038..fce1854 100644 --- a/package.json +++ b/package.json @@ -1,19 +1,25 @@ { "name": "@catppuccin/palette", - "version": "0.1.4", + "version": "0.1.5", "description": "Soothing pastel themes for the high-spirited!", - "main": "index.js", - "type": "module", + "main": "dist/index.js", + "module": "dist/index.mjs", "exports": { - ".": "./index.js", + ".": { + "require": "./dist/index.cjs", + "import": "./dist/index.mjs" + }, "./style": "./css/catppuccin.css" }, "scripts": { - "test": "ava" + "test": "ava", + "build": "node esbuild.js", + "prepublishOnly": "npm run build" }, "files": [ "css/", - "index.js", + "dist/index.cjs", + "dist/index.mjs", "index.d.ts" ], "types": "index.d.ts", @@ -39,6 +45,7 @@ }, "homepage": "https://github.com/catppuccin/palette#readme", "devDependencies": { - "ava": "^4.2.0" + "ava": "^4.2.0", + "esbuild": "^0.14.42" } }