Skip to content

Commit f2e38ac

Browse files
authored
fix: optimize tree-shakoing-for-devtools-pkgs (#1531)
1 parent 2c7b358 commit f2e38ac

File tree

4 files changed

+28
-20
lines changed

4 files changed

+28
-20
lines changed

packages/core-base/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@
3333
"jsdelivr": "dist/core-base.global.js",
3434
"types": "dist/core-base.d.ts",
3535
"dependencies": {
36-
"@intlify/devtools-if": "workspace:*",
3736
"@intlify/message-compiler": "workspace:*",
38-
"@intlify/shared": "workspace:*",
37+
"@intlify/shared": "workspace:*"
38+
},
39+
"devDependencies": {
40+
"@intlify/devtools-if": "workspace:*",
3941
"@intlify/vue-devtools": "workspace:*"
4042
},
4143
"engines": {

packages/devtools-if/src/index.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ export interface IntlifyRecord {
77
types: Record<string, string | Symbol> // TODO
88
}
99

10-
export const IntlifyDevToolsHooks = /* #__PURE__*/ {
11-
I18nInit: 'i18n:init',
12-
FunctionTranslate: 'function:translate'
13-
} as const
10+
export const enum IntlifyDevToolsHooks {
11+
I18nInit = 'i18n:init',
12+
FunctionTranslate = 'function:translate'
13+
}
1414

1515
export type AdditionalPayloads = {
1616
meta?: Record<string, unknown>
1717
}
1818

19-
export type IntlifyDevToolsHooks =
20-
(typeof IntlifyDevToolsHooks)[keyof typeof IntlifyDevToolsHooks]
19+
// export type IntlifyDevToolsHooks =
20+
// (typeof IntlifyDevToolsHooks)[keyof typeof IntlifyDevToolsHooks]
2121

2222
export type IntlifyDevToolsHookPayloads = {
2323
[IntlifyDevToolsHooks.I18nInit]: {
@@ -35,8 +35,8 @@ export type IntlifyDevToolsHookPayloads = {
3535
}
3636

3737
export type IntlifyDevToolsEmitterHooks = {
38-
[IntlifyDevToolsHooks.I18nInit]: IntlifyDevToolsHookPayloads[typeof IntlifyDevToolsHooks.I18nInit]
39-
[IntlifyDevToolsHooks.FunctionTranslate]: IntlifyDevToolsHookPayloads[typeof IntlifyDevToolsHooks.FunctionTranslate]
38+
[IntlifyDevToolsHooks.I18nInit]: IntlifyDevToolsHookPayloads[IntlifyDevToolsHooks.I18nInit]
39+
[IntlifyDevToolsHooks.FunctionTranslate]: IntlifyDevToolsHookPayloads[IntlifyDevToolsHooks.FunctionTranslate]
4040
}
4141

4242
export type IntlifyDevToolsEmitter = Emittable<IntlifyDevToolsEmitterHooks>

packages/vue-i18n/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737
"dependencies": {
3838
"@intlify/core-base": "workspace:*",
3939
"@intlify/shared": "workspace:*",
40-
"@intlify/vue-devtools": "workspace:*",
4140
"@vue/devtools-api": "^6.5.0"
4241
},
4342
"devDependencies": {
43+
"@intlify/vue-devtools": "workspace:*",
4444
"@intlify/devtools-if": "workspace:*"
4545
},
4646
"peerDependencies": {

pnpm-lock.yaml

Lines changed: 15 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)