diff --git a/.gitignore b/.gitignore index e8de6f8..b6674dd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ coverage/ .DS_Store node_modules/ +dist/ diff --git a/.prettierignore b/.prettierignore index 404abb2..d64c4ca 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1 +1,2 @@ coverage/ +dist/ diff --git a/package.json b/package.json index 3b08541..8df8869 100644 --- a/package.json +++ b/package.json @@ -2,10 +2,20 @@ "name": "@tlecommunity/client", "version": "0.1.0", "description": "API Client for the community edition of The Lacuna Expanse", - "main": "", + "files": [ + "dist" + ], + "main": "./dist/client.umd.js", + "module": "./dist/client.mjs", + "types": "./dist/", + "exports": { + ".": { + "import": "./dist/client.mjs", + "require": "./dist/client.umd.js" + } + }, "scripts": { - "dev": "vite", - "build": "vite build", + "build": "vite build && tsc --emitDeclarationOnly --outDir dist", "test": "jest --coverage", "lint": "prettier --check **/*.{ts,tsx,md,js,jsx,css,scss,yml}", "lint:fix": "prettier --write **/*.{ts,tsx,md,js,jsx,css,scss,yml}" diff --git a/tsconfig.json b/tsconfig.json index de3bffd..e27b646 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,6 +3,10 @@ "target": "es6", "module": "es6", "esModuleInterop": true, - "moduleResolution": "node" - } + "moduleResolution": "node", + "isolatedModules": true, + "declaration": true + }, + "include": ["lib/"], + "exclude": ["**/__tests__/"] } diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..fd68626 --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,10 @@ +import { defineConfig } from 'vite'; + +export default defineConfig({ + build: { + lib: { + entry: './lib/index', + name: 'client', + }, + }, +});