1
0
mirror of synced 2025-12-13 14:29:27 +08:00

build: 构建时某些文件的.d文件丢失

This commit is contained in:
roymondchen
2022-08-05 19:59:19 +08:00
committed by jia000
parent 9ffecf62f7
commit 5e36ca8e47
56 changed files with 919 additions and 1083 deletions

View File

@@ -6,7 +6,7 @@
],
"main": "dist/tmagic-core.umd.js",
"module": "dist/tmagic-core.mjs",
"types": "dist/types/src/index.d.ts",
"types": "types/index.d.ts",
"exports": {
".": {
"import": "./dist/tmagic-core.mjs",
@@ -20,7 +20,9 @@
},
"license": "Apache-2.0",
"scripts": {
"build": "vite build"
"build": "npm run build:type && vite build",
"build:type": "npm run clear:type && tsc --declaration --emitDeclarationOnly --project tsconfig.build.json",
"clear:type": "rimraf ./types"
},
"engines": {
"node": ">=14"
@@ -39,8 +41,8 @@
"devDependencies": {
"@types/events": "^3.0.0",
"@types/node": "^15.12.4",
"rimraf": "^3.0.2",
"typescript": "^4.7.4",
"vite": "^3.0.4",
"vite-plugin-dts": "^0.9.6"
"vite": "^3.0.4"
}
}

View File

@@ -0,0 +1,13 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": ".",
"declaration": true,
"declarationDir": "types",
"forceConsistentCasingInFileNames": true,
"paths": {},
},
"include": [
"src"
],
}

View File

@@ -3,7 +3,4 @@
"compilerOptions": {
"baseUrl": "../..",
},
"exclude": [
"**/dist/**/*"
],
}

View File

@@ -19,21 +19,10 @@
import path from 'path';
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
import pkg from './package.json';
export default defineConfig({
plugins: [
dts({
outputDir: 'dist/types',
include: ['src/**/*'],
staticImport: true,
insertTypesEntry: true,
logDiagnostics: true,
}),
],
resolve: {
alias:
process.env.NODE_ENV === 'production'