@umijs/bundler-webpack 3.5.36 → 3.5.37

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.
@@ -542,13 +542,12 @@ function _getConfig() {
542
542
 
543
543
  const nodeLibs = require('node-libs-browser');
544
544
 
545
- if (isWebpack5) {
545
+ const nodePolyfill = process.env.NODE_POLYFILL !== 'none';
546
+
547
+ if (isWebpack5 && nodePolyfill) {
546
548
  ret.plugins.push(new bundleImplementor.ProvidePlugin({
547
- process: nodeLibs['process']
548
- }));
549
- ret.plugins.push( // ref: https://github.com/umijs/umi/issues/6914
550
- // @ts-ignore
551
- new bundleImplementor.ProvidePlugin({
549
+ process: nodeLibs['process'],
550
+ // ref: https://github.com/umijs/umi/issues/6914
552
551
  Buffer: ['buffer', 'Buffer']
553
552
  })); // @ts-ignore
554
553
 
@@ -29,8 +29,10 @@ function getFileName(filePath) {
29
29
  let inited = false;
30
30
 
31
31
  function init() {
32
+ const skipRequireHookInit = process.env.INIT_REQUIRE_HOOK === 'none'; // Don't hook webpack when has skip flag
32
33
  // Allow run once
33
- if (inited) return;
34
+
35
+ if (skipRequireHookInit || inited) return;
34
36
  inited = true;
35
37
  const filesMap = files.map(file => {
36
38
  const fileName = getFileName(file);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/bundler-webpack",
3
- "version": "3.5.36",
3
+ "version": "3.5.37",
4
4
  "description": "@umijs/bundler-webpack",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -37,11 +37,11 @@
37
37
  "strip-ansi": "6.0.0"
38
38
  },
39
39
  "dependencies": {
40
- "@umijs/bundler-utils": "3.5.36",
40
+ "@umijs/bundler-utils": "3.5.37",
41
41
  "@umijs/case-sensitive-paths-webpack-plugin": "^1.0.1",
42
- "@umijs/deps": "3.5.36",
43
- "@umijs/types": "3.5.36",
44
- "@umijs/utils": "3.5.36",
42
+ "@umijs/deps": "3.5.37",
43
+ "@umijs/types": "3.5.37",
44
+ "@umijs/utils": "3.5.37",
45
45
  "jest-worker": "26.6.2",
46
46
  "node-libs-browser": "2.2.1",
47
47
  "normalize-url": "1.9.1",