@umijs/bundler-webpack 3.5.28 → 3.5.29-alpha.0

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.
@@ -38,6 +38,8 @@ function _path() {
38
38
  return data;
39
39
  }
40
40
 
41
+ var _pkgUpContainName = require("./pkgUpContainName");
42
+
41
43
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
42
44
 
43
45
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
@@ -85,9 +87,7 @@ function isMatch(opts) {
85
87
  function getPkgPath(opts) {
86
88
  const dir = (0, _path().dirname)(opts.path);
87
89
  if (dir in pkgPathCache) return pkgPathCache[dir];
88
- pkgPathCache[dir] = _utils().pkgUp.sync({
89
- cwd: opts.path
90
- });
90
+ pkgPathCache[dir] = (0, _pkgUpContainName.pkgUpContainName)(dir);
91
91
  return pkgPathCache[dir];
92
92
  }
93
93
 
@@ -16,16 +16,6 @@ function _react() {
16
16
  return data;
17
17
  }
18
18
 
19
- function _utils() {
20
- const data = require("@umijs/utils");
21
-
22
- _utils = function _utils() {
23
- return data;
24
- };
25
-
26
- return data;
27
- }
28
-
29
19
  function _path() {
30
20
  const data = require("path");
31
21
 
@@ -36,6 +26,8 @@ function _path() {
36
26
  return data;
37
27
  }
38
28
 
29
+ var _pkgUpContainName = require("./pkgUpContainName");
30
+
39
31
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
40
32
 
41
33
  const pkgPathCache = {};
@@ -43,9 +35,7 @@ const pkgPathCache = {};
43
35
  function getPkgPath(filePath) {
44
36
  const dir = (0, _path().dirname)(filePath);
45
37
  if (dir in pkgPathCache) return pkgPathCache[dir];
46
- pkgPathCache[dir] = _utils().pkgUp.sync({
47
- cwd: filePath
48
- });
38
+ pkgPathCache[dir] = (0, _pkgUpContainName.pkgUpContainName)(dir);
49
39
  return pkgPathCache[dir];
50
40
  }
51
41
 
@@ -0,0 +1 @@
1
+ export declare const pkgUpContainName: (dir: string) => string | null;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.pkgUpContainName = void 0;
7
+
8
+ function _react() {
9
+ const data = _interopRequireDefault(require("react"));
10
+
11
+ _react = function _react() {
12
+ return data;
13
+ };
14
+
15
+ return data;
16
+ }
17
+
18
+ function _utils() {
19
+ const data = require("@umijs/utils");
20
+
21
+ _utils = function _utils() {
22
+ return data;
23
+ };
24
+
25
+ return data;
26
+ }
27
+
28
+ function _path() {
29
+ const data = _interopRequireDefault(require("path"));
30
+
31
+ _path = function _path() {
32
+ return data;
33
+ };
34
+
35
+ return data;
36
+ }
37
+
38
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
39
+
40
+ const pkgUpContainName = dir => {
41
+ let pkgPath = _utils().pkgUp.sync({
42
+ cwd: dir
43
+ });
44
+
45
+ if (!pkgPath) return pkgPath;
46
+
47
+ const _require = require(pkgPath),
48
+ name = _require.name; // invalid package
49
+
50
+
51
+ if (!name) return pkgUpContainName(_path().default.dirname(dir));
52
+ return pkgPath;
53
+ };
54
+
55
+ exports.pkgUpContainName = pkgUpContainName;
package/lib/index.js CHANGED
@@ -152,6 +152,8 @@ class Bundler {
152
152
  } catch (e) {}
153
153
 
154
154
  console.error(err);
155
+
156
+ _utils().printHelp.feedback();
155
157
  }
156
158
  });
157
159
  resolve({
@@ -169,6 +171,9 @@ class Bundler {
169
171
  } catch (e) {}
170
172
 
171
173
  console.error(err);
174
+
175
+ _utils().printHelp.feedback();
176
+
172
177
  return reject(new Error('build failed'));
173
178
  } // ref: https://github.com/webpack/webpack/issues/12345#issuecomment-755273757
174
179
  // @ts-ignore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/bundler-webpack",
3
- "version": "3.5.28",
3
+ "version": "3.5.29-alpha.0",
4
4
  "description": "@umijs/bundler-webpack",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -21,7 +21,7 @@
21
21
  ],
22
22
  "license": "MIT",
23
23
  "bugs": "http://github.com/umijs/umi/issues",
24
- "homepage": "https://github.com/umijs/umi/tree/master/packages/bundler-webpack#readme",
24
+ "homepage": "https://github.com/umijs/umi/tree/3.x/packages/bundler-webpack#readme",
25
25
  "publishConfig": {
26
26
  "access": "public"
27
27
  },
@@ -37,10 +37,10 @@
37
37
  "strip-ansi": "6.0.0"
38
38
  },
39
39
  "dependencies": {
40
- "@umijs/bundler-utils": "3.5.28",
41
- "@umijs/deps": "3.5.28",
42
- "@umijs/types": "3.5.28",
43
- "@umijs/utils": "3.5.28",
40
+ "@umijs/bundler-utils": "3.5.29-alpha.0",
41
+ "@umijs/deps": "3.5.29-alpha.0",
42
+ "@umijs/types": "3.5.29-alpha.0",
43
+ "@umijs/utils": "3.5.29-alpha.0",
44
44
  "jest-worker": "26.6.2",
45
45
  "node-libs-browser": "2.2.1",
46
46
  "normalize-url": "1.9.1",