-
Notifications
You must be signed in to change notification settings - Fork 4.9k
chore: add tsdown #17746
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
chore: add tsdown #17746
Changes from all commits
c91e8e0
cce5917
a86deca
db37e6d
ba7f37a
ad2bac1
bcf1855
ff6e8aa
79612a4
19107e3
2282a81
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,32 @@ | ||
| // 字符串简写 | ||
| // 不要使用 const enum https://www.typescriptlang.org/docs/handbook/enums.html#const-enum-pitfalls | ||
| export const enum Shortcuts { | ||
| Container = 'container', | ||
| Childnodes = 'cn', | ||
| Text = 'v', | ||
| NodeType = 'nt', | ||
| NodeName = 'nn', | ||
|
|
||
| // Attrtibutes | ||
| // Attributes | ||
| Sid = 'sid', | ||
| Style = 'st', | ||
| Class = 'cl', | ||
| Src = 'src' | ||
| } | ||
|
|
||
| // 会导致 @taro/tests 运行失败,暂时不用 | ||
| // export const Shortcuts = { | ||
| // Container: 'container', | ||
| // Childnodes: 'cn', | ||
| // Text: 'v', | ||
| // NodeType: 'nt', | ||
| // NodeName: 'nn', | ||
|
|
||
| // // Attributes | ||
| // Sid: 'sid', | ||
| // Style: 'st', | ||
| // Class: 'cl', | ||
| // Src: 'src' | ||
| // } as const | ||
|
|
||
| // export type Shortcuts = typeof Shortcuts[keyof typeof Shortcuts] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,5 @@ | |
| "declaration": true, | ||
| "declarationDir": "types" | ||
| }, | ||
| "include": [ | ||
| "./src" | ||
| ] | ||
| "include": ["./src"] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,9 @@ | ||
| const path = require('path') | ||
| import path from 'node:path' | ||
| import { fileURLToPath } from 'node:url' | ||
|
|
||
| module.exports = { | ||
| const __dirname = path.dirname(fileURLToPath(import.meta.url)) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 在 package.json 里加了
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 我个人倾向于先保持 commonjs 的效果,避免一些意外。 |
||
|
|
||
| export default { | ||
| globals: { | ||
| ENABLE_INNER_HTML: true, | ||
| ENABLE_ADJACENT_HTML: true, | ||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| import { defineConfig } from 'tsdown' | ||
|
|
||
| export default [ | ||
| defineConfig({ | ||
| entry: 'src/index.ts', | ||
| noExternal: ['@tarojs/shared'], | ||
| treeshake: false, | ||
| sourcemap: true, | ||
| unbundle: true, | ||
| }), | ||
| defineConfig({ | ||
| entry: { | ||
| 'runtime.esm': 'src/index.ts', | ||
| }, | ||
| noExternal: ['@tarojs/shared'], | ||
| treeshake: false, | ||
| sourcemap: true, | ||
| }), | ||
| defineConfig({ | ||
| entry: { | ||
| 'index.cjs': 'src/index.ts', | ||
| }, | ||
| noExternal: ['@tarojs/shared'], | ||
| format: 'cjs', | ||
| outExtensions: () => ({ js: '.js' }), | ||
| treeshake: false, | ||
| sourcemap: true, | ||
| }), | ||
| ] |
Uh oh!
There was an error while loading. Please reload this page.