Skip to content

Commit b9a4625

Browse files
committed
fix: build type error. #99
1 parent f2982ba commit b9a4625

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

build/build.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,7 @@ webpack(webpackConfig, (err, stats) => {
4444
});
4545

4646
buildTypesProcess.on('close', () => {
47-
console.log(chalk.cyan('Build types complete.\n'));
48-
49-
fs.copyFile('types/components/Tree/index.d.ts', 'lib/vue-json-pretty.d.ts', err => {
50-
if (err) throw err;
51-
console.log(chalk.cyan('Build major d.ts complete.\n'));
52-
});
47+
console.log(chalk.cyan('Build types(.d.ts) complete.\n'));
5348
});
5449
}
5550
});

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"test": "cypress open",
1313
"lint": "eslint --ext .ts,.tsx,.vue src example"
1414
},
15+
"typings": "types/index.d.ts",
1516
"repository": {
1617
"type": "git",
1718
"url": "[email protected]:leezng/vue-json-pretty.git"

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { defineComponent } from 'vue';
12
import Tree from './components/Tree';
23

3-
export default Tree;
4+
export default defineComponent(Tree);

tsconfig.dts.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"declarationDir": "types"
1010
},
1111
"include": [
12-
"src/components/**/*.ts",
13-
"src/components/**/*.tsx",
14-
"src/components/**/*.vue"
12+
"src/**/*.ts",
13+
"src/**/*.tsx",
14+
"src/**/*.vue"
1515
],
1616
}

0 commit comments

Comments
 (0)