refactor: convert to proper esm / cjs hybrid package

This commit is contained in:
Paul Makles
2023-04-20 18:50:22 +01:00
parent 5086a10462
commit b71b43c4db
3 changed files with 19 additions and 6 deletions
+5 -3
View File
@@ -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 <insrt.uk>",
"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"
+10
View File
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"target": "es2016",
"module": "commonjs",
"declaration": true,
"declarationMap": true,
"outDir": "./lib/cjs"
}
}
+4 -3
View File
@@ -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,