diff --git a/package.json b/package.json index 9467d43c..62939e62 100644 --- a/package.json +++ b/package.json @@ -2,13 +2,15 @@ "name": "revolt.js", "version": "7.0.0-beta.1", "main": "lib/cjs/index.js", - "module": "src/index.ts", + "module": "lib/esm/index.js", "types": "src/index.ts", "repository": "https://github.com/revoltchat/revolt.js", "author": "Paul Makles ", "license": "MIT", "scripts": { - "build": "tsc", + "build": "tsc && tsc -p tsconfig.cjs.json", + "build:esm": "tsc", + "build:cjs": "tsc -p tsconfig.cjs.json", "build:watch": "tsc-watch --onSuccess \"node .\"", "lint": "eslint --ext .ts,.tsx src/", "lint:fix": "eslint --fix --ext .ts,.tsx src/", @@ -31,7 +33,7 @@ "isomorphic-ws": "^5.0.0", "long": "^5.2.1", "revolt-api": "^0.5.17", - "solid-js": "^1.7.2", + "solid-js": "^1.7.3", "typedoc": "^0.24.1", "ulid": "^2.3.0", "ws": "^8.13.0" diff --git a/tsconfig.cjs.json b/tsconfig.cjs.json new file mode 100644 index 00000000..084cf2f7 --- /dev/null +++ b/tsconfig.cjs.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "target": "es2016", + "module": "commonjs", + "declaration": true, + "declarationMap": true, + "outDir": "./lib/cjs" + } +} diff --git a/tsconfig.json b/tsconfig.json index db3c8eac..2fd75e8f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,11 +1,12 @@ { "compilerOptions": { - "target": "es2016", - "module": "commonjs", + "target": "ES2022", + "module": "ES6", + "moduleResolution": "node", "rootDir": "./src", "declaration": true, "declarationMap": true, - "outDir": "./lib/cjs", + "outDir": "./lib/esm", "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "strict": true,