Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gulpfie.base.js): 生成dts #682

Merged
merged 2 commits into from
Sep 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion script/gulpfile.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const generateConfigReplaceTask = (replaceConfig, options = {}) => {
/* return gulpfile base tasks */
module.exports = (src, dist, moduleName) => {
const tsProject = gulpTs.createProject('tsconfig.json', {
declaration: !isProduction,
declaration: true,
removeComments: isProduction,
});

Expand Down
10 changes: 10 additions & 0 deletions site/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ npm i tdesign-miniprogram -S --production

> 因为 [该配置](https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#style) 表示启用新版组件样式,将会导致 TDesign 的组件样式错乱。

## 修改 tsconfig.json
如果使用`typescript`开发,需要修改`tsconfig.json`指定`paths`
```json
{
"paths": {
"tdesign-miniprogram/*":["./miniprogram/miniprogram_npm/tdesign-miniprogram/*"]
}
}
```

## 使用组件

以按钮组件为例,只需要在 `JSON` 文件中引入按钮对应的自定义组件即可
Expand Down