mirror of
https://github.com/jwetzell/psn-js.git
synced 2026-08-14 20:03:57 +00:00
add support for bundling both esm and cjs versions
This commit is contained in:
+14
-3
@@ -2,11 +2,22 @@
|
||||
"name": "@jwetzell/posistagenet",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"main": "./dist/cjs/index.js",
|
||||
"module": "./dist/esm/index.js",
|
||||
"types": "./dist/types/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./dist/esm/index.js",
|
||||
"require": "./dist/cjs/index.js",
|
||||
"types": "./dist/types/index.d.ts"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"prebuild": "rimraf dist",
|
||||
"build": "tsc",
|
||||
"build": "npm run build:cjs && npm run build:esm && npm run build:types",
|
||||
"build:cjs":"tsc -p tsconfig.cjs.json",
|
||||
"build:esm":"tsc -p tsconfig.esm.json",
|
||||
"build:types":"tsc -p tsconfig.types.json",
|
||||
"example:client": "node examples/psn_client.js",
|
||||
"example:server": "node examples/psn_server.js",
|
||||
"prepublishOnly": "npm run build"
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "CommonJS",
|
||||
"declaration": false,
|
||||
"outDir": "./dist/cjs"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "ESNext",
|
||||
"declaration": false,
|
||||
"outDir": "./dist/esm"
|
||||
}
|
||||
}
|
||||
+7
-7
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"moduleResolution": "Node",
|
||||
"lib": ["ESNext"],
|
||||
"target": "ESNext",
|
||||
"esModuleInterop": true,
|
||||
"module": "commonjs",
|
||||
"target": "ES2020",
|
||||
"declaration": true,
|
||||
"rootDir": "./src",
|
||||
"strict": true,
|
||||
"outDir": "dist"
|
||||
"isolatedModules": true,
|
||||
"rootDir": "src/",
|
||||
"strict": true
|
||||
},
|
||||
"exclude": ["node_modules", "dist", "examples"]
|
||||
"include": ["src/"]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"emitDeclarationOnly": true,
|
||||
"declaration": true,
|
||||
"outDir": "./dist/types"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user