@umijs/babel-preset-umi 4.0.1 → 4.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +6 -3
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -43,13 +43,16 @@ exports.default = (_context, opts) => {
43
43
  [
44
44
  require.resolve('@umijs/bundler-utils/compiled/babel/preset-typescript'),
45
45
  {
46
- // 支持vue 后缀
46
+ // 支持 vue 后缀
47
47
  allExtensions: true,
48
- // 支持tsx
48
+ // 支持 tsx
49
49
  isTSX: true,
50
50
  allowNamespaces: true,
51
51
  allowDeclareFields: true,
52
- onlyRemoveTypeImports: true,
52
+ // Why false?
53
+ // 如果为 true,babel 只删除 import type 语句,会保留其他通过 import 引入的 type
54
+ // 这些 type 引用走到 webpack 之后,就会报错
55
+ onlyRemoveTypeImports: false,
53
56
  optimizeConstEnums: true,
54
57
  ...opts.presetTypeScript,
55
58
  },
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@umijs/babel-preset-umi",
3
- "version": "4.0.1",
3
+ "version": "4.0.4",
4
4
  "description": "Official babel preset for umi.",
5
- "homepage": "https://github.com/umijs/umi-next/tree/master/packages/babel-preset-umi#readme",
6
- "bugs": "https://github.com/umijs/umi-next/issues",
5
+ "homepage": "https://github.com/umijs/umi/tree/master/packages/babel-preset-umi#readme",
6
+ "bugs": "https://github.com/umijs/umi/issues",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/umijs/umi-next"
9
+ "url": "https://github.com/umijs/umi"
10
10
  },
11
11
  "license": "MIT",
12
12
  "main": "dist/index.js",
@@ -17,14 +17,14 @@
17
17
  "scripts": {
18
18
  "build": "pnpm tsc",
19
19
  "build:deps": "umi-scripts bundleDeps",
20
- "dev": "pnpm build -- --watch",
20
+ "dev": "pnpm build --watch",
21
21
  "test": "umi-scripts jest-turbo"
22
22
  },
23
23
  "dependencies": {
24
24
  "@babel/runtime": "7.17.9",
25
25
  "@bloomberg/record-tuple-polyfill": "0.0.4",
26
- "@umijs/bundler-utils": "4.0.1",
27
- "@umijs/utils": "4.0.1",
26
+ "@umijs/bundler-utils": "4.0.4",
27
+ "@umijs/utils": "4.0.4",
28
28
  "core-js": "3.22.4"
29
29
  },
30
30
  "publishConfig": {