@umijs/babel-preset-umi 4.0.0-beta.7 → 4.0.0-rc.2

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 +5 -2
  2. package/package.json +17 -17
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const utils_1 = require("@umijs/utils");
6
7
  const path_1 = require("path");
7
8
  const autoCSSModules_1 = __importDefault(require("./plugins/autoCSSModules"));
8
9
  const dynamicImportNode_1 = __importDefault(require("./plugins/dynamicImportNode"));
@@ -18,7 +19,7 @@ exports.default = (_context, opts) => {
18
19
  // 推荐用 top level 的 assumptions 配置
19
20
  loose: false,
20
21
  // 保留 es modules 语法,交给 webpack 处理
21
- modules: false, debug: false, useBuiltIns: 'entry', corejs: '3',
22
+ modules: false, debug: false, useBuiltIns: 'entry', corejs: (0, utils_1.getCorejsVersion)((0, path_1.join)(__dirname, '../package.json')),
22
23
  // 没必要,遇到了应该改 targets 配置
23
24
  forceAllTransforms: false, ignoreBrowserslistConfig: true }, opts.presetEnv),
24
25
  ],
@@ -82,7 +83,9 @@ exports.default = (_context, opts) => {
82
83
  useESModules: false,
83
84
  // lock the version of @babel/runtime
84
85
  // make sure we are using the correct version
85
- absoluteRuntime: (0, path_1.dirname)(require.resolve('@babel/runtime/package.json')), version: `^${require('@babel/runtime/package.json').version}` }, opts.pluginTransformRuntime),
86
+ // ref: https://github.com/babel/babel/blob/v7.16.12/packages/babel-plugin-transform-runtime/src/get-runtime-path/index.ts#L19
87
+ // ref: https://github.com/umijs/umi/pull/7816
88
+ absoluteRuntime: (0, path_1.dirname)(require.resolve('../package.json')), version: `^${require('@babel/runtime/package.json').version}` }, opts.pluginTransformRuntime),
86
89
  ],
87
90
  // none official plugins
88
91
  opts.pluginLockCoreJS && [lockCoreJS_1.default],
package/package.json CHANGED
@@ -1,7 +1,14 @@
1
1
  {
2
2
  "name": "@umijs/babel-preset-umi",
3
- "version": "4.0.0-beta.7",
3
+ "version": "4.0.0-rc.2",
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",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/umijs/umi-next"
10
+ },
11
+ "license": "MIT",
5
12
  "main": "dist/index.js",
6
13
  "types": "dist/index.d.ts",
7
14
  "files": [
@@ -12,24 +19,17 @@
12
19
  "build:deps": "pnpm esno ../../scripts/bundleDeps.ts",
13
20
  "dev": "pnpm build -- --watch"
14
21
  },
15
- "repository": {
16
- "type": "git",
17
- "url": "https://github.com/umijs/umi-next"
22
+ "dependencies": {
23
+ "@babel/runtime": "7.17.2",
24
+ "@bloomberg/record-tuple-polyfill": "0.0.4",
25
+ "@umijs/bundler-utils": "4.0.0-rc.2",
26
+ "@umijs/utils": "4.0.0-rc.2",
27
+ "core-js": "3.21.1"
18
28
  },
19
- "authors": [
20
- "chencheng <sorrycc@gmail.com> (https://github.com/sorrycc)"
21
- ],
22
- "license": "MIT",
23
- "bugs": "https://github.com/umijs/umi-next/issues",
24
- "homepage": "https://github.com/umijs/umi-next/tree/master/packages/babel-preset-umi#readme",
25
29
  "publishConfig": {
26
30
  "access": "public"
27
31
  },
28
- "dependencies": {
29
- "@babel/runtime": "7.16.0",
30
- "@bloomberg/record-tuple-polyfill": "0.0.4",
31
- "@umijs/bundler-utils": "4.0.0-beta.7",
32
- "@umijs/utils": "4.0.0-beta.7",
33
- "core-js": "3.19.0"
34
- }
32
+ "authors": [
33
+ "chencheng <sorrycc@gmail.com> (https://github.com/sorrycc)"
34
+ ]
35
35
  }