[core] To standardize tsconfig.prod.json and tsconfig.json, .d.ts declaration files are also provided in the dist directory. To ensure compatibility with different versions of Node.js, you should modify the "exports" and "type" fields in package.json

This commit is contained in:
Revone 2023-10-13 10:29:08 +08:00
parent b78586a0ef
commit 86e3bb2a94
3 changed files with 10 additions and 4 deletions

View file

@ -7,6 +7,11 @@
"types": "lib/index.d.ts",
"source": "src/index.ts",
"umd:main": "umd/bundle.min.js",
"type": "module",
"exports": {
"import": "./lib/index.js",
"require": "./dist/index.js"
},
"scripts": {
"build": "npm run build:es6 && npm run build:commonjs && npm run build:umd && npm run build:docs",
"build:es6": "rm -rf lib && tsc",
@ -34,7 +39,7 @@
"type": "git",
"url": "git+https://github.com/zrwusa/data-structure-typed.git"
},
"author": "Tyler Zeng zrwusa@gmail.com",
"author": "Tyler Zeng <zrwusa@gmail.com>",
"license": "MIT",
"publishConfig": {
"@zrwusa:registry": "https://npm.pkg.github.com"

View file

@ -1,9 +1,9 @@
{
"compilerOptions": {
"target": "ES6",
"module": "ES6",
"outDir": "./lib",
"declaration": true,
"module": "ES6",
"target": "ES6",
"lib": [
"ESNext"
],

View file

@ -3,10 +3,11 @@
"target": "ES6",
"module": "CommonJS",
"outDir": "./dist",
"sourceMap": true,
"declaration": true,
"lib": [
"ESNext"
],
"sourceMap": true,
"strict": true,
"downlevelIteration": true,
"removeComments": true,