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

[Question] 0.1.32 umd打包如何生成 xxx.d.ts 文件 #131

Open
WuChenDi opened this issue Jul 19, 2023 · 2 comments
Open

[Question] 0.1.32 umd打包如何生成 xxx.d.ts 文件 #131

WuChenDi opened this issue Jul 19, 2023 · 2 comments

Comments

@WuChenDi
Copy link

Hey, man.

我目前在投入 lowcode 相关工作,在 lowcode 当中,我注意到他们使用了 "@alib/build-scripts": "^0.1.32" 进行构建和打包。

然而,我目前无法找到关于这个配置的任何文档。如果您了解相关信息,是否能够分享给我呢?

我的问题是,在生成 UMD 文件时,应该如何生成 xxx.d.ts 文件?以下是我的配置文件:

  • package.json
{
  "scripts": {
    "build": "build-scripts build && build-scripts build --config=build.umd.json"
  }
}
  • build.umd.json
{
  "entry": {
    "vue-renderer": "./src/index.ts"
  },
  "sourceMap": true,
  "library": "LCVueRenderer",
  "libraryTarget": "umd",
  "externals": {
    "vue": "var window.Vue"
  },
  "outputAssetsPath": {
    "js": "",
    "css": ""
  },
  "polyfill": false,
  "outputDir": "dist",
  "vendor": false,
  "ignoreHtmlTemplate": true,
  "plugins": [
    "build-plugin-react-app",
    ["build-plugin-moment-locales", { "locales": ["zh-cn"] }],
    "./build.plugin.cjs"
  ]
}
@ClarkXia
Copy link
Collaborator

*.d.ts 由 ts 编译生成,一般在编译 es / lib 目录时会生成,在消费 umd 的时候是不需要的

@WuChenDi
Copy link
Author

*.d.ts 由 ts 编译生成,一般在编译 es / lib 目录时会生成,在消费 umd 的时候是不需要的

Thank you for your response.

是的呢,目前构建之后看结果是这样,但是我这边不太想提供 es/ lib 目录,想提供 dist 产物就好,支持这样的配置吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants