@teambit/webpack 0.0.881 → 0.0.882

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 (48) hide show
  1. package/dist/config/html.js +2 -2
  2. package/dist/config/html.js.map +1 -1
  3. package/dist/config/webpack-fallbacks-aliases.js.map +1 -1
  4. package/dist/config/webpack-fallbacks-provide-plugin-config.js.map +1 -1
  5. package/dist/config/webpack-fallbacks.js +7 -28
  6. package/dist/config/webpack-fallbacks.js.map +1 -1
  7. package/dist/config/webpack.config.js +1 -45
  8. package/dist/config/webpack.config.js.map +1 -1
  9. package/dist/config/webpack.dev.config.js +14 -58
  10. package/dist/config/webpack.dev.config.js.map +1 -1
  11. package/dist/events/index.js +0 -4
  12. package/dist/events/index.js.map +1 -1
  13. package/dist/events/webpack-compilation-done-event.js +1 -12
  14. package/dist/events/webpack-compilation-done-event.js.map +1 -1
  15. package/dist/events/webpack-compilation-started-event.js +1 -10
  16. package/dist/events/webpack-compilation-started-event.js.map +1 -1
  17. package/dist/index.js +0 -35
  18. package/dist/index.js.map +1 -1
  19. package/dist/plugins/webpack-bit-reporter-plugin.js +4 -16
  20. package/dist/plugins/webpack-bit-reporter-plugin.js.map +1 -1
  21. package/dist/transformers/get-exposed-rules.js +0 -18
  22. package/dist/transformers/get-exposed-rules.js.map +1 -1
  23. package/dist/transformers/get-externals.js +0 -10
  24. package/dist/transformers/get-externals.js.map +1 -1
  25. package/dist/transformers/index.js +0 -9
  26. package/dist/transformers/index.js.map +1 -1
  27. package/dist/transformers/inject-body.js +0 -5
  28. package/dist/transformers/inject-body.js.map +1 -1
  29. package/dist/transformers/inject-head.js +0 -4
  30. package/dist/transformers/inject-head.js.map +1 -1
  31. package/dist/transformers/resolve-peer.js +2 -22
  32. package/dist/transformers/resolve-peer.js.map +1 -1
  33. package/dist/transformers/transformers.js +5 -20
  34. package/dist/transformers/transformers.js.map +1 -1
  35. package/dist/webpack.aspect.js +0 -5
  36. package/dist/webpack.aspect.js.map +1 -1
  37. package/dist/webpack.bundler.js +2 -33
  38. package/dist/webpack.bundler.js.map +1 -1
  39. package/dist/webpack.composition.js +0 -6
  40. package/dist/webpack.composition.js.map +1 -1
  41. package/dist/webpack.dev-server.js +8 -25
  42. package/dist/webpack.dev-server.js.map +1 -1
  43. package/dist/webpack.main.runtime.js +9 -74
  44. package/dist/webpack.main.runtime.js.map +1 -1
  45. package/package-tar/teambit-webpack-0.0.882.tgz +0 -0
  46. package/package.json +5 -5
  47. package/{preview-1666409808293.js → preview-1666496165706.js} +2 -2
  48. package/package-tar/teambit-webpack-0.0.881.tgz +0 -0
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.html = html;
7
-
8
7
  /** html template for Previews (docs, compositions, etc) */
9
8
  function html(title) {
10
9
  return () => `
@@ -25,7 +24,8 @@ function html(title) {
25
24
  </body>
26
25
  </html>
27
26
  `;
28
- } // <!-- minimal css resets -->
27
+ }
28
+ // <!-- minimal css resets -->
29
29
  // <style> html { height: 100%; } body { margin: 0; height: 100%; } #root { height: 100%; } </style>
30
30
 
31
31
  //# sourceMappingURL=html.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["html","title"],"sources":["html.ts"],"sourcesContent":["/** html template for Previews (docs, compositions, etc) */\nexport function html(title: string) {\n return () => `\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>${title}</title>\n <script>\n // Allow to use react dev-tools inside the examples\n try { window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__; } catch {}\n </script>\n <style> body { margin: 0; } </style>\n </head>\n <body>\n <div id=\"root\"></div>\n </body>\n </html>\n `;\n}\n// <!-- minimal css resets -->\n// <style> html { height: 100%; } body { margin: 0; height: 100%; } #root { height: 100%; } </style>\n"],"mappings":";;;;;;;AAAA;AACO,SAASA,IAAT,CAAcC,KAAd,EAA6B;EAClC,OAAO,MAAO;AAChB;AACA;AACA;AACA;AACA;AACA,eAAeA,KAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAjBE;AAkBD,C,CACD;AACA"}
1
+ {"version":3,"names":["html","title"],"sources":["html.ts"],"sourcesContent":["/** html template for Previews (docs, compositions, etc) */\nexport function html(title: string) {\n return () => `\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>${title}</title>\n <script>\n // Allow to use react dev-tools inside the examples\n try { window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__; } catch {}\n </script>\n <style> body { margin: 0; } </style>\n </head>\n <body>\n <div id=\"root\"></div>\n </body>\n </html>\n `;\n}\n// <!-- minimal css resets -->\n// <style> html { height: 100%; } body { margin: 0; height: 100%; } #root { height: 100%; } </style>\n"],"mappings":";;;;;;AAAA;AACO,SAASA,IAAI,CAACC,KAAa,EAAE;EAClC,OAAO,MAAO;AAChB;AACA;AACA;AACA;AACA;AACA,eAAeA,KAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA"}
@@ -1 +1 @@
1
- {"version":3,"names":["fallbacksAliases","process","require","resolve","buffer"],"sources":["webpack-fallbacks-aliases.ts"],"sourcesContent":["export const fallbacksAliases = {\n process: require.resolve('process/browser'),\n buffer: require.resolve('buffer/'),\n};\n"],"mappings":";;;;;;AAAO,MAAMA,gBAAgB,GAAG;EAC9BC,OAAO,EAAEC,OAAO,CAACC,OAAR,CAAgB,iBAAhB,CADqB;EAE9BC,MAAM,EAAEF,OAAO,CAACC,OAAR,CAAgB,SAAhB;AAFsB,CAAzB"}
1
+ {"version":3,"names":["fallbacksAliases","process","require","resolve","buffer"],"sources":["webpack-fallbacks-aliases.ts"],"sourcesContent":["export const fallbacksAliases = {\n process: require.resolve('process/browser'),\n buffer: require.resolve('buffer/'),\n};\n"],"mappings":";;;;;;AAAO,MAAMA,gBAAgB,GAAG;EAC9BC,OAAO,EAAEC,OAAO,CAACC,OAAO,CAAC,iBAAiB,CAAC;EAC3CC,MAAM,EAAEF,OAAO,CAACC,OAAO,CAAC,SAAS;AACnC,CAAC;AAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":["fallbacksProvidePluginConfig","process","require","resolve","Buffer"],"sources":["webpack-fallbacks-provide-plugin-config.ts"],"sourcesContent":["export const fallbacksProvidePluginConfig = {\n process: require.resolve('process/browser'),\n Buffer: [require.resolve('buffer/'), 'Buffer'],\n};\n"],"mappings":";;;;;;AAAO,MAAMA,4BAA4B,GAAG;EAC1CC,OAAO,EAAEC,OAAO,CAACC,OAAR,CAAgB,iBAAhB,CADiC;EAE1CC,MAAM,EAAE,CAACF,OAAO,CAACC,OAAR,CAAgB,SAAhB,CAAD,EAA6B,QAA7B;AAFkC,CAArC"}
1
+ {"version":3,"names":["fallbacksProvidePluginConfig","process","require","resolve","Buffer"],"sources":["webpack-fallbacks-provide-plugin-config.ts"],"sourcesContent":["export const fallbacksProvidePluginConfig = {\n process: require.resolve('process/browser'),\n Buffer: [require.resolve('buffer/'), 'Buffer'],\n};\n"],"mappings":";;;;;;AAAO,MAAMA,4BAA4B,GAAG;EAC1CC,OAAO,EAAEC,OAAO,CAACC,OAAO,CAAC,iBAAiB,CAAC;EAC3CC,MAAM,EAAE,CAACF,OAAO,CAACC,OAAO,CAAC,SAAS,CAAC,EAAE,QAAQ;AAC/C,CAAC;AAAC"}
@@ -4,54 +4,33 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.fallbacks = void 0;
7
-
8
7
  // based on https://github1s.com/vercel/next.js/blob/canary/packages/next/build/webpack-config.ts
9
8
  // Full list of old polyfills is accessible here:
10
9
  // https://github.com/webpack/webpack/blob/2a0536cf510768111a3a6dceeb14cb79b9f59273/lib/ModuleNotFoundError.js#L13-L42
11
- const assertFallbackPath = require.resolve('assert/');
12
10
 
11
+ const assertFallbackPath = require.resolve('assert/');
13
12
  const bufferFallbackPath = require.resolve('buffer/');
14
-
15
13
  const constantsFallbackPath = require.resolve('constants-browserify');
16
-
17
14
  const cryptoFallbackPath = require.resolve('crypto-browserify');
18
-
19
15
  const domainFallbackPath = require.resolve('domain-browser');
20
-
21
16
  const httpFallbackPath = require.resolve('stream-http');
22
-
23
17
  const httpsFallbackPath = require.resolve('https-browserify');
24
-
25
18
  const osFallbackPath = require.resolve('os-browserify/browser');
26
-
27
19
  const pathFallbackPath = require.resolve('path-browserify');
28
-
29
20
  const punycodeFallbackPath = require.resolve('punycode/');
30
-
31
- const processFallbackPath = require.resolve('process/browser'); // Handled in separate alias
32
-
33
-
21
+ const processFallbackPath = require.resolve('process/browser');
22
+ // Handled in separate alias
34
23
  const querystringFallbackPath = require.resolve('querystring-es3');
35
-
36
24
  const streamFallbackPath = require.resolve('stream-browserify');
37
-
38
25
  const string_decoderFallbackPath = require.resolve('string_decoder/');
39
-
40
26
  const sysFallbackPath = require.resolve('util/');
41
-
42
27
  const timersFallbackPath = require.resolve('timers-browserify');
43
-
44
- const ttyFallbackPath = require.resolve('tty-browserify'); // Handled in separate alias
45
-
46
-
28
+ const ttyFallbackPath = require.resolve('tty-browserify');
29
+ // Handled in separate alias
47
30
  const urlFallbackPath = require.resolve('url/');
48
-
49
31
  const utilFallbackPath = require.resolve('util/');
50
-
51
32
  const vmFallbackPath = require.resolve('vm-browserify');
52
-
53
33
  const zlibFallbackPath = require.resolve('browserify-zlib');
54
-
55
34
  const fallbacks = {
56
35
  assert: assertFallbackPath,
57
36
  buffer: bufferFallbackPath,
@@ -77,12 +56,12 @@ const fallbacks = {
77
56
  fs: false,
78
57
  net: false,
79
58
  tls: false,
80
- child_process: false // file: false,
59
+ child_process: false
60
+ // file: false,
81
61
  // module: false,
82
62
  // pnpapi: false,
83
63
  // readline: false,
84
64
  // worker_threads: false,
85
-
86
65
  };
87
66
  exports.fallbacks = fallbacks;
88
67
 
@@ -1 +1 @@
1
- {"version":3,"names":["assertFallbackPath","require","resolve","bufferFallbackPath","constantsFallbackPath","cryptoFallbackPath","domainFallbackPath","httpFallbackPath","httpsFallbackPath","osFallbackPath","pathFallbackPath","punycodeFallbackPath","processFallbackPath","querystringFallbackPath","streamFallbackPath","string_decoderFallbackPath","sysFallbackPath","timersFallbackPath","ttyFallbackPath","urlFallbackPath","utilFallbackPath","vmFallbackPath","zlibFallbackPath","fallbacks","assert","buffer","constants","crypto","domain","http","https","os","path","punycode","process","querystring","stream","string_decoder","sys","timers","tty","url","util","vm","zlib","fs","net","tls","child_process"],"sources":["webpack-fallbacks.ts"],"sourcesContent":["// based on https://github1s.com/vercel/next.js/blob/canary/packages/next/build/webpack-config.ts\n// Full list of old polyfills is accessible here:\n// https://github.com/webpack/webpack/blob/2a0536cf510768111a3a6dceeb14cb79b9f59273/lib/ModuleNotFoundError.js#L13-L42\n\nconst assertFallbackPath = require.resolve('assert/');\nconst bufferFallbackPath = require.resolve('buffer/');\nconst constantsFallbackPath = require.resolve('constants-browserify');\nconst cryptoFallbackPath = require.resolve('crypto-browserify');\nconst domainFallbackPath = require.resolve('domain-browser');\nconst httpFallbackPath = require.resolve('stream-http');\nconst httpsFallbackPath = require.resolve('https-browserify');\nconst osFallbackPath = require.resolve('os-browserify/browser');\nconst pathFallbackPath = require.resolve('path-browserify');\nconst punycodeFallbackPath = require.resolve('punycode/');\nconst processFallbackPath = require.resolve('process/browser');\n// Handled in separate alias\nconst querystringFallbackPath = require.resolve('querystring-es3');\nconst streamFallbackPath = require.resolve('stream-browserify');\nconst string_decoderFallbackPath = require.resolve('string_decoder/');\nconst sysFallbackPath = require.resolve('util/');\nconst timersFallbackPath = require.resolve('timers-browserify');\nconst ttyFallbackPath = require.resolve('tty-browserify');\n// Handled in separate alias\nconst urlFallbackPath = require.resolve('url/');\nconst utilFallbackPath = require.resolve('util/');\nconst vmFallbackPath = require.resolve('vm-browserify');\nconst zlibFallbackPath = require.resolve('browserify-zlib');\n\nexport const fallbacks = {\n assert: assertFallbackPath,\n buffer: bufferFallbackPath,\n constants: constantsFallbackPath,\n crypto: cryptoFallbackPath,\n domain: domainFallbackPath,\n http: httpFallbackPath,\n https: httpsFallbackPath,\n os: osFallbackPath,\n path: pathFallbackPath,\n punycode: punycodeFallbackPath,\n process: processFallbackPath,\n querystring: querystringFallbackPath,\n stream: streamFallbackPath,\n string_decoder: string_decoderFallbackPath,\n sys: sysFallbackPath,\n timers: timersFallbackPath,\n tty: ttyFallbackPath,\n url: urlFallbackPath,\n util: utilFallbackPath,\n vm: vmFallbackPath,\n zlib: zlibFallbackPath,\n fs: false,\n net: false,\n tls: false,\n child_process: false,\n // file: false,\n // module: false,\n // pnpapi: false,\n // readline: false,\n // worker_threads: false,\n} as const;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAEA,MAAMA,kBAAkB,GAAGC,OAAO,CAACC,OAAR,CAAgB,SAAhB,CAA3B;;AACA,MAAMC,kBAAkB,GAAGF,OAAO,CAACC,OAAR,CAAgB,SAAhB,CAA3B;;AACA,MAAME,qBAAqB,GAAGH,OAAO,CAACC,OAAR,CAAgB,sBAAhB,CAA9B;;AACA,MAAMG,kBAAkB,GAAGJ,OAAO,CAACC,OAAR,CAAgB,mBAAhB,CAA3B;;AACA,MAAMI,kBAAkB,GAAGL,OAAO,CAACC,OAAR,CAAgB,gBAAhB,CAA3B;;AACA,MAAMK,gBAAgB,GAAGN,OAAO,CAACC,OAAR,CAAgB,aAAhB,CAAzB;;AACA,MAAMM,iBAAiB,GAAGP,OAAO,CAACC,OAAR,CAAgB,kBAAhB,CAA1B;;AACA,MAAMO,cAAc,GAAGR,OAAO,CAACC,OAAR,CAAgB,uBAAhB,CAAvB;;AACA,MAAMQ,gBAAgB,GAAGT,OAAO,CAACC,OAAR,CAAgB,iBAAhB,CAAzB;;AACA,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tB,uBAZU;EAavBuB,MAAM,EAAEtB,kBAbe;EAcvBuB,cAAc,EAAEtB,0BAdO;EAevBuB,GAAG,EAAEtB,eAfkB;EAgBvBuB,MAAM,EAAEtB,kBAhBe;EAiBvBuB,GAAG,EAAEtB,eAjBkB;EAkBvBuB,GAAG,EAAEtB,eAlBkB;EAmBvBuB,IAAI,EAAEtB,gBAnBiB;EAoBvBuB,EAAE,EAAEtB,cApBmB;EAqBvBuB,IAAI,EAAEtB,gBArBiB;EAsBvBuB,EAAE,EAAE,KAtBmB;EAuBvBC,GAAG,EAAE,KAvBkB;EAwBvBC,GAAG,EAAE,KAxBkB;EAyBvBC,aAAa,EAAE,KAzBQ,CA0BvB;EACA;EACA;EACA;EACA;;AA9BuB,CAAlB"}
1
+ {"version":3,"names":["assertFallbackPath","require","resolve","bufferFallbackPath","constantsFallbackPath","cryptoFallbackPath","domainFallbackPath","httpFallbackPath","httpsFallbackPath","osFallbackPath","pathFallbackPath","punycodeFallbackPath","processFallbackPath","querystringFallbackPath","streamFallbackPath","string_decoderFallbackPath","sysFallbackPath","timersFallbackPath","ttyFallbackPath","urlFallbackPath","utilFallbackPath","vmFallbackPath","zlibFallbackPath","fallbacks","assert","buffer","constants","crypto","domain","http","https","os","path","punycode","process","querystring","stream","string_decoder","sys","timers","tty","url","util","vm","zlib","fs","net","tls","child_process"],"sources":["webpack-fallbacks.ts"],"sourcesContent":["// based on https://github1s.com/vercel/next.js/blob/canary/packages/next/build/webpack-config.ts\n// Full list of old polyfills is accessible here:\n// https://github.com/webpack/webpack/blob/2a0536cf510768111a3a6dceeb14cb79b9f59273/lib/ModuleNotFoundError.js#L13-L42\n\nconst assertFallbackPath = require.resolve('assert/');\nconst bufferFallbackPath = require.resolve('buffer/');\nconst constantsFallbackPath = require.resolve('constants-browserify');\nconst cryptoFallbackPath = require.resolve('crypto-browserify');\nconst domainFallbackPath = require.resolve('domain-browser');\nconst httpFallbackPath = require.resolve('stream-http');\nconst httpsFallbackPath = require.resolve('https-browserify');\nconst osFallbackPath = require.resolve('os-browserify/browser');\nconst pathFallbackPath = require.resolve('path-browserify');\nconst punycodeFallbackPath = require.resolve('punycode/');\nconst processFallbackPath = require.resolve('process/browser');\n// Handled in separate alias\nconst querystringFallbackPath = require.resolve('querystring-es3');\nconst streamFallbackPath = require.resolve('stream-browserify');\nconst string_decoderFallbackPath = require.resolve('string_decoder/');\nconst sysFallbackPath = require.resolve('util/');\nconst timersFallbackPath = require.resolve('timers-browserify');\nconst ttyFallbackPath = require.resolve('tty-browserify');\n// Handled in separate alias\nconst urlFallbackPath = require.resolve('url/');\nconst utilFallbackPath = require.resolve('util/');\nconst vmFallbackPath = require.resolve('vm-browserify');\nconst zlibFallbackPath = require.resolve('browserify-zlib');\n\nexport const fallbacks = {\n assert: assertFallbackPath,\n buffer: bufferFallbackPath,\n constants: constantsFallbackPath,\n crypto: cryptoFallbackPath,\n domain: domainFallbackPath,\n http: httpFallbackPath,\n https: httpsFallbackPath,\n os: osFallbackPath,\n path: pathFallbackPath,\n punycode: punycodeFallbackPath,\n process: processFallbackPath,\n querystring: querystringFallbackPath,\n stream: streamFallbackPath,\n string_decoder: string_decoderFallbackPath,\n sys: sysFallbackPath,\n timers: timersFallbackPath,\n tty: ttyFallbackPath,\n url: urlFallbackPath,\n util: utilFallbackPath,\n vm: vmFallbackPath,\n zlib: zlibFallbackPath,\n fs: false,\n net: false,\n tls: false,\n child_process: false,\n // file: false,\n // module: false,\n // pnpapi: false,\n // readline: false,\n // worker_threads: false,\n} as const;\n"],"mappings":";;;;;;AAAA;AACA;AACA;;AAEA,MAAMA,kBAAkB,GAAGC,OAAO,CAACC,OAAO,CAAC,SAAS,CAAC;AACrD,MAAMC,kBAAkB,GAAGF,OAAO,CAACC,OAAO,CAAC,SAAS,CAAC;AACrD,MAAME,qBAAqB,GAAGH,OAAO,CAACC,OAAO,CAAC,sBAAsB,CAAC;AACrE,MAAMG,kBAAkB,GAAGJ,OAAO,CAACC,OAAO,CAAC,mBAA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AAM,EAAEtB,kBAAkB;EAC1BuB,SAAS,EAAEtB,qBAAqB;EAChCuB,MAAM,EAAEtB,kBAAkB;EAC1BuB,MAAM,EAAEtB,kBAAkB;EAC1BuB,IAAI,EAAEtB,gBAAgB;EACtBuB,KAAK,EAAEtB,iBAAiB;EACxBuB,EAAE,EAAEtB,cAAc;EAClBuB,IAAI,EAAEtB,gBAAgB;EACtBuB,QAAQ,EAAEtB,oBAAoB;EAC9BuB,OAAO,EAAEtB,mBAAmB;EAC5BuB,WAAW,EAAEtB,uBAAuB;EACpCuB,MAAM,EAAEtB,kBAAkB;EAC1BuB,cAAc,EAAEtB,0BAA0B;EAC1CuB,GAAG,EAAEtB,eAAe;EACpBuB,MAAM,EAAEtB,kBAAkB;EAC1BuB,GAAG,EAAEtB,eAAe;EACpBuB,GAAG,EAAEtB,eAAe;EACpBuB,IAAI,EAAEtB,gBAAgB;EACtBuB,EAAE,EAAEtB,cAAc;EAClBuB,IAAI,EAAEtB,gBAAgB;EACtBuB,EAAE,EAAE,KAAK;EACTC,GAAG,EAAE,KAAK;EACVC,GAAG,EAAE,KAAK;EACVC,aAAa,EAAE;EACf;EACA;EACA;EACA;EACA;AACF,CAAU;AAAC"}
@@ -1,114 +1,82 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  require("core-js/modules/es.array.iterator.js");
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
8
  exports.configFactory = configFactory;
11
-
12
9
  function _webpack() {
13
10
  const data = _interopRequireDefault(require("webpack"));
14
-
15
11
  _webpack = function () {
16
12
  return data;
17
13
  };
18
-
19
14
  return data;
20
15
  }
21
-
22
16
  function _lodash() {
23
17
  const data = require("lodash");
24
-
25
18
  _lodash = function () {
26
19
  return data;
27
20
  };
28
-
29
21
  return data;
30
22
  }
31
-
32
23
  function _compressionWebpackPlugin() {
33
24
  const data = _interopRequireDefault(require("compression-webpack-plugin"));
34
-
35
25
  _compressionWebpackPlugin = function () {
36
26
  return data;
37
27
  };
38
-
39
28
  return data;
40
29
  }
41
-
42
30
  function _path() {
43
31
  const data = require("path");
44
-
45
32
  _path = function () {
46
33
  return data;
47
34
  };
48
-
49
35
  return data;
50
36
  }
51
-
52
37
  function _htmlWebpackPlugin() {
53
38
  const data = _interopRequireDefault(require("html-webpack-plugin"));
54
-
55
39
  _htmlWebpackPlugin = function () {
56
40
  return data;
57
41
  };
58
-
59
42
  return data;
60
43
  }
61
-
62
44
  function _webpackAssetsManifest() {
63
45
  const data = _interopRequireDefault(require("webpack-assets-manifest"));
64
-
65
46
  _webpackAssetsManifest = function () {
66
47
  return data;
67
48
  };
68
-
69
49
  return data;
70
50
  }
71
-
72
51
  function _webpackFallbacks() {
73
52
  const data = require("./webpack-fallbacks");
74
-
75
53
  _webpackFallbacks = function () {
76
54
  return data;
77
55
  };
78
-
79
56
  return data;
80
57
  }
81
-
82
58
  function _webpackFallbacksProvidePluginConfig() {
83
59
  const data = require("./webpack-fallbacks-provide-plugin-config");
84
-
85
60
  _webpackFallbacksProvidePluginConfig = function () {
86
61
  return data;
87
62
  };
88
-
89
63
  return data;
90
64
  }
91
-
92
65
  function _webpackFallbacksAliases() {
93
66
  const data = require("./webpack-fallbacks-aliases");
94
-
95
67
  _webpackFallbacksAliases = function () {
96
68
  return data;
97
69
  };
98
-
99
70
  return data;
100
71
  }
101
-
102
72
  /* eslint-disable complexity */
73
+
103
74
  function configFactory(target, context) {
104
75
  var _target$html, _target$compress, _target$chunking;
105
-
106
76
  let truthyEntries = Array.isArray(target.entries) && target.entries.length ? target.entries.filter(Boolean) : target.entries || {};
107
-
108
77
  if (Array.isArray(truthyEntries) && !truthyEntries.length) {
109
78
  truthyEntries = {};
110
79
  }
111
-
112
80
  const dev = Boolean(context.development);
113
81
  const htmlConfig = (_target$html = target.html) !== null && _target$html !== void 0 ? _target$html : context.html;
114
82
  const compress = (_target$compress = target.compress) !== null && _target$compress !== void 0 ? _target$compress : context.compress;
@@ -139,24 +107,20 @@ function configFactory(target, context) {
139
107
  },
140
108
  plugins: [new (_webpack().default.ProvidePlugin)(_webpackFallbacksProvidePluginConfig().fallbacksProvidePluginConfig), getAssetManifestPlugin()]
141
109
  };
142
-
143
110
  if (target.filename) {
144
111
  config.output = config.output || {};
145
112
  config.output.filename = target.filename;
146
113
  }
147
-
148
114
  if (target.chunkFilename) {
149
115
  config.output = config.output || {};
150
116
  config.output.chunkFilename = target.chunkFilename;
151
117
  }
152
-
153
118
  if (target.runtimeChunkName) {
154
119
  config.optimization = config.optimization || {};
155
120
  config.optimization.runtimeChunk = {
156
121
  name: target.runtimeChunkName
157
122
  };
158
123
  }
159
-
160
124
  if (splitChunks) {
161
125
  config.optimization = config.optimization || {};
162
126
  config.optimization.splitChunks = {
@@ -164,36 +128,28 @@ function configFactory(target, context) {
164
128
  name: false
165
129
  };
166
130
  }
167
-
168
131
  if (htmlPlugins && htmlPlugins.length) {
169
132
  if (!config.plugins) {
170
133
  config.plugins = [];
171
134
  }
172
-
173
135
  config.plugins = config.plugins.concat(htmlPlugins);
174
136
  }
175
-
176
137
  if (compress) {
177
138
  if (!config.plugins) {
178
139
  config.plugins = [];
179
140
  }
180
-
181
141
  config.plugins = config.plugins.concat(new (_compressionWebpackPlugin().default)());
182
142
  }
183
-
184
143
  return config;
185
144
  }
186
-
187
145
  function getAssetManifestPlugin() {
188
146
  return new (_webpackAssetsManifest().default)({
189
147
  entrypoints: true
190
148
  });
191
149
  }
192
-
193
150
  function generateHtmlPlugins(configs) {
194
151
  return configs.map(config => generateHtmlPlugin(config));
195
152
  }
196
-
197
153
  function generateHtmlPlugin(config) {
198
154
  const baseConfig = {
199
155
  filename: config.filename,
@@ -1 +1 @@
1
- {"version":3,"names":["configFactory","target","context","truthyEntries","Array","isArray","entries","length","filter","Boolean","dev","development","htmlConfig","html","compress","htmlPlugins","generateHtmlPlugins","undefined","splitChunks","chunking","config","mode","bail","entry","infrastructureLogging","level","output","path","outputPath","sep","stats","errorDetails","resolve","alias","fallbacksAliases","fallback","fallbacks","plugins","webpack","ProvidePlugin","fallbacksProvidePluginConfig","getAssetManifestPlugin","filename","chunkFilename","runtimeChunkName","optimization","runtimeChunk","name","chunks","concat","CompressionPlugin","WebpackAssetsManifest","entrypoints","configs","map","generateHtmlPlugin","baseConfig","chunksSortMode","chunkOrder","title","templateContent","minify","cache","favicon","filteredConfig","omitBy","isUndefined","HtmlWebpackPlugin"],"sources":["webpack.config.ts"],"sourcesContent":["/* eslint-disable complexity */\nimport webpack, { Configuration } from 'webpack';\nimport { isUndefined, omitBy } from 'lodash';\nimport CompressionPlugin from 'compression-webpack-plugin';\nimport { sep } from 'path';\nimport type { BundlerContext, BundlerHtmlConfig, Target } from '@teambit/bundler';\nimport HtmlWebpackPlugin from 'html-webpack-plugin';\nimport WebpackAssetsManifest from 'webpack-assets-manifest';\nimport { fallbacks } from './webpack-fallbacks';\nimport { fallbacksProvidePluginConfig } from './webpack-fallbacks-provide-plugin-config';\nimport { fallbacksAliases } from './webpack-fallbacks-aliases';\n\nexport function configFactory(target: Target, context: BundlerContext): Configuration {\n let truthyEntries =\n Array.isArray(target.entries) && target.entries.length ? target.entries.filter(Boolean) : target.entries || {};\n if (Array.isArray(truthyEntries) && !truthyEntries.length) {\n truthyEntries = {};\n }\n\n const dev = Boolean(context.development);\n const htmlConfig = target.html ?? context.html;\n const compress = target.compress ?? context.compress;\n const htmlPlugins = htmlConfig ? generateHtmlPlugins(htmlConfig) : undefined;\n const splitChunks = target.chunking?.splitChunks;\n\n const config: Configuration = {\n mode: dev ? 'development' : 'production',\n // Stop compilation early in production\n bail: true,\n // These are the \"entry points\" to our application.\n // This means they will be the \"root\" imports that are included in JS bundle.\n // @ts-ignore\n entry: truthyEntries,\n\n infrastructureLogging: {\n level: 'error',\n },\n\n output: {\n // The build folder.\n path: `${target.outputPath}${sep}public`,\n },\n stats: {\n errorDetails: true,\n },\n\n resolve: {\n // TODO - check - we should not need both fallbacks and alias and provider plugin\n alias: fallbacksAliases,\n\n fallback: fallbacks,\n },\n\n plugins: [new webpack.ProvidePlugin(fallbacksProvidePluginConfig), getAssetManifestPlugin()],\n };\n\n if (target.filename) {\n config.output = config.output || {};\n config.output.filename = target.filename;\n }\n\n if (target.chunkFilename) {\n config.output = config.output || {};\n config.output.chunkFilename = target.chunkFilename;\n }\n\n if (target.runtimeChunkName) {\n config.optimization = config.optimization || {};\n config.optimization.runtimeChunk = {\n name: target.runtimeChunkName,\n };\n }\n\n if (splitChunks) {\n config.optimization = config.optimization || {};\n config.optimization.splitChunks = {\n chunks: 'all',\n name: false,\n };\n }\n\n if (htmlPlugins && htmlPlugins.length) {\n if (!config.plugins) {\n config.plugins = [];\n }\n config.plugins = config.plugins.concat(htmlPlugins);\n }\n if (compress) {\n if (!config.plugins) {\n config.plugins = [];\n }\n config.plugins = config.plugins.concat(new CompressionPlugin());\n }\n return config;\n}\n\nfunction getAssetManifestPlugin() {\n return new WebpackAssetsManifest({ entrypoints: true });\n}\n\nfunction generateHtmlPlugins(configs: BundlerHtmlConfig[]) {\n return configs.map((config) => generateHtmlPlugin(config));\n}\n\nfunction generateHtmlPlugin(config: BundlerHtmlConfig) {\n const baseConfig: HtmlWebpackPlugin.Options = {\n filename: config.filename,\n chunks: config.chunks,\n chunksSortMode: config.chunkOrder,\n title: config.title,\n templateContent: config.templateContent,\n minify: config.minify,\n cache: false,\n favicon: config.favicon,\n };\n\n const filteredConfig = omitBy(baseConfig, isUndefined);\n return new HtmlWebpackPlugin(filteredConfig);\n}\n"],"mappings":";;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAA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AiBjB,MAAM,CAACiB,OAAP,CAAeY,MAAf,CAAsBlC,WAAtB,CAAjB;EACD;;EACD,IAAID,QAAJ,EAAc;IACZ,IAAI,CAACM,MAAM,CAACiB,OAAZ,EAAqB;MACnBjB,MAAM,CAACiB,OAAP,GAAiB,EAAjB;IACD;;IACDjB,MAAM,CAACiB,OAAP,GAAiBjB,MAAM,CAACiB,OAAP,CAAeY,MAAf,CAAsB,KAAIC,mCAAJ,GAAtB,CAAjB;EACD;;EACD,OAAO9B,MAAP;AACD;;AAED,SAASqB,sBAAT,GAAkC;EAChC,OAAO,KAAIU,gCAAJ,EAA0B;IAAEC,WAAW,EAAE;EAAf,CAA1B,CAAP;AACD;;AAED,SAASpC,mBAAT,CAA6BqC,OAA7B,EAA2D;EACzD,OAAOA,OAAO,CAACC,GAAR,CAAalC,MAAD,IAAYmC,kBAAkB,CAACnC,MAAD,CAA1C,CAAP;AACD;;AAED,SAASmC,kBAAT,CAA4BnC,MAA5B,EAAuD;EACrD,MAAMoC,UAAqC,GAAG;IAC5Cd,QAAQ,EAAEtB,MAAM,CAACsB,QAD2B;IAE5CM,MAAM,EAAE5B,MAAM,CAAC4B,MAF6B;IAG5CS,cAAc,EAAErC,MAAM,CAACsC,UAHqB;IAI5CC,KAAK,EAAEvC,MAAM,CAACuC,KAJ8B;IAK5CC,eAAe,EAAExC,MAAM,CAACwC,eALoB;IAM5CC,MAAM,EAAEzC,MAAM,CAACyC,MAN6B;IAO5CC,KAAK,EAAE,KAPqC;IAQ5CC,OAAO,EAAE3C,MAAM,CAAC2C;EAR4B,CAA9C;EAWA,MAAMC,cAAc,GAAG,IAAAC,gBAAA,EAAOT,UAAP,EAAmBU,qBAAnB,CAAvB;EACA,OAAO,KAAIC,4BAAJ,EAAsBH,cAAtB,CAAP;AACD"}
1
+ {"version":3,"names":["configFactory","target","context","truthyEntries","Array","isArray","entries","length","filter","Boolean","dev","development","htmlConfig","html","compress","htmlPlugins","generateHtmlPlugins","undefined","splitChunks","chunking","config","mode","bail","entry","infrastructureLogging","level","output","path","outputPath","sep","stats","errorDetails","resolve","alias","fallbacksAliases","fallback","fallbacks","plugins","webpack","ProvidePlugin","fallbacksProvidePluginConfig","getAssetManifestPlugin","filename","chunkFilename","runtimeChunkName","optimization","runtimeChunk","name","chunks","concat","CompressionPlugin","WebpackAssetsManifest","entrypoints","configs","map","generateHtmlPlugin","baseConfig","chunksSortMode","chunkOrder","title","templateContent","minify","cache","favicon","filteredConfig","omitBy","isUndefined","HtmlWebpackPlugin"],"sources":["webpack.config.ts"],"sourcesContent":["/* eslint-disable complexity */\nimport webpack, { Configuration } from 'webpack';\nimport { isUndefined, omitBy } from 'lodash';\nimport CompressionPlugin from 'compression-webpack-plugin';\nimport { sep } from 'path';\nimport type { BundlerContext, BundlerHtmlConfig, Target } from '@teambit/bundler';\nimport HtmlWebpackPlugin from 'html-webpack-plugin';\nimport WebpackAssetsManifest from 'webpack-assets-manifest';\nimport { fallbacks } from './webpack-fallbacks';\nimport { fallbacksProvidePluginConfig } from './webpack-fallbacks-provide-plugin-config';\nimport { fallbacksAliases } from './webpack-fallbacks-aliases';\n\nexport function configFactory(target: Target, context: BundlerContext): Configuration {\n let truthyEntries =\n Array.isArray(target.entries) && target.entries.length ? target.entries.filter(Boolean) : target.entries || {};\n if (Array.isArray(truthyEntries) && !truthyEntries.length) {\n truthyEntries = {};\n }\n\n const dev = Boolean(context.development);\n const htmlConfig = target.html ?? context.html;\n const compress = target.compress ?? context.compress;\n const htmlPlugins = htmlConfig ? generateHtmlPlugins(htmlConfig) : undefined;\n const splitChunks = target.chunking?.splitChunks;\n\n const config: Configuration = {\n mode: dev ? 'development' : 'production',\n // Stop compilation early in production\n bail: true,\n // These are the \"entry points\" to our application.\n // This means they will be the \"root\" imports that are included in JS bundle.\n // @ts-ignore\n entry: truthyEntries,\n\n infrastructureLogging: {\n level: 'error',\n },\n\n output: {\n // The build folder.\n path: `${target.outputPath}${sep}public`,\n },\n stats: {\n errorDetails: true,\n },\n\n resolve: {\n // TODO - check - we should not need both fallbacks and alias and provider plugin\n alias: fallbacksAliases,\n\n fallback: fallbacks,\n },\n\n plugins: [new webpack.ProvidePlugin(fallbacksProvidePluginConfig), getAssetManifestPlugin()],\n };\n\n if (target.filename) {\n config.output = config.output || {};\n config.output.filename = target.filename;\n }\n\n if (target.chunkFilename) {\n config.output = config.output || {};\n config.output.chunkFilename = target.chunkFilename;\n }\n\n if (target.runtimeChunkName) {\n config.optimization = config.optimization || {};\n config.optimization.runtimeChunk = {\n name: target.runtimeChunkName,\n };\n }\n\n if (splitChunks) {\n config.optimization = config.optimization || {};\n config.optimization.splitChunks = {\n chunks: 'all',\n name: false,\n };\n }\n\n if (htmlPlugins && htmlPlugins.length) {\n if (!config.plugins) {\n config.plugins = [];\n }\n config.plugins = config.plugins.concat(htmlPlugins);\n }\n if (compress) {\n if (!config.plugins) {\n config.plugins = [];\n }\n config.plugins = config.plugins.concat(new CompressionPlugin());\n }\n return config;\n}\n\nfunction getAssetManifestPlugin() {\n return new WebpackAssetsManifest({ entrypoints: true });\n}\n\nfunction generateHtmlPlugins(configs: BundlerHtmlConfig[]) {\n return configs.map((config) => generateHtmlPlugin(config));\n}\n\nfunction generateHtmlPlugin(config: BundlerHtmlConfig) {\n const baseConfig: HtmlWebpackPlugin.Options = {\n filename: config.filename,\n chunks: config.chunks,\n chunksSortMode: config.chunkOrder,\n title: config.title,\n templateContent: config.templateContent,\n minify: config.minify,\n cache: false,\n favicon: config.favicon,\n };\n\n const filteredConfig = omitBy(baseConfig, isUndefined);\n return new HtmlWebpackPlugin(filteredConfig);\n}\n"],"mappings":";;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;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AW,CAAC;EACrD;EACA,IAAID,QAAQ,EAAE;IACZ,IAAI,CAACM,MAAM,CAACiB,OAAO,EAAE;MACnBjB,MAAM,CAACiB,OAAO,GAAG,EAAE;IACrB;IACAjB,MAAM,CAACiB,OAAO,GAAGjB,MAAM,CAACiB,OAAO,CAACY,MAAM,CAAC,KAAIC,mCAAiB,GAAE,CAAC;EACjE;EACA,OAAO9B,MAAM;AACf;AAEA,SAASqB,sBAAsB,GAAG;EAChC,OAAO,KAAIU,gCAAqB,EAAC;IAAEC,WAAW,EAAE;EAAK,CAAC,CAAC;AACzD;AAEA,SAASpC,mBAAmB,CAACqC,OAA4B,EAAE;EACzD,OAAOA,OAAO,CAACC,GAAG,CAAElC,MAAM,IAAKmC,kBAAkB,CAACnC,MAAM,CAAC,CAAC;AAC5D;AAEA,SAASmC,kBAAkB,CAACnC,MAAyB,EAAE;EACrD,MAAMoC,UAAqC,GAAG;IAC5Cd,QAAQ,EAAEtB,MAAM,CAACsB,QAAQ;IACzBM,MAAM,EAAE5B,MAAM,CAAC4B,MAAM;IACrBS,cAAc,EAAErC,MAAM,CAACsC,UAAU;IACjCC,KAAK,EAAEvC,MAAM,CAACuC,KAAK;IACnBC,eAAe,EAAExC,MAAM,CAACwC,eAAe;IACvCC,MAAM,EAAEzC,MAAM,CAACyC,MAAM;IACrBC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE3C,MAAM,CAAC2C;EAClB,CAAC;EAED,MAAMC,cAAc,GAAG,IAAAC,gBAAM,EAACT,UAAU,EAAEU,qBAAW,CAAC;EACtD,OAAO,KAAIC,4BAAiB,EAACH,cAAc,CAAC;AAC9C"}
@@ -1,158 +1,113 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.configFactory = configFactory;
9
-
10
8
  function _path() {
11
9
  const data = _interopRequireDefault(require("path"));
12
-
13
10
  _path = function () {
14
11
  return data;
15
12
  };
16
-
17
13
  return data;
18
14
  }
19
-
20
15
  function _webpack() {
21
16
  const data = _interopRequireDefault(require("webpack"));
22
-
23
17
  _webpack = function () {
24
18
  return data;
25
19
  };
26
-
27
20
  return data;
28
21
  }
29
-
30
22
  function _htmlWebpackPlugin() {
31
23
  const data = _interopRequireDefault(require("html-webpack-plugin"));
32
-
33
24
  _htmlWebpackPlugin = function () {
34
25
  return data;
35
26
  };
36
-
37
27
  return data;
38
28
  }
39
-
40
29
  function _errorOverlayMiddleware() {
41
30
  const data = _interopRequireDefault(require("react-dev-utils/errorOverlayMiddleware"));
42
-
43
31
  _errorOverlayMiddleware = function () {
44
32
  return data;
45
33
  };
46
-
47
34
  return data;
48
35
  }
49
-
50
36
  function _evalSourceMapMiddleware() {
51
37
  const data = _interopRequireDefault(require("react-dev-utils/evalSourceMapMiddleware"));
52
-
53
38
  _evalSourceMapMiddleware = function () {
54
39
  return data;
55
40
  };
56
-
57
41
  return data;
58
42
  }
59
-
60
43
  function _noopServiceWorkerMiddleware() {
61
44
  const data = _interopRequireDefault(require("react-dev-utils/noopServiceWorkerMiddleware"));
62
-
63
45
  _noopServiceWorkerMiddleware = function () {
64
46
  return data;
65
47
  };
66
-
67
48
  return data;
68
49
  }
69
-
70
50
  function _redirectServedPathMiddleware() {
71
51
  const data = _interopRequireDefault(require("react-dev-utils/redirectServedPathMiddleware"));
72
-
73
52
  _redirectServedPathMiddleware = function () {
74
53
  return data;
75
54
  };
76
-
77
55
  return data;
78
56
  }
79
-
80
57
  function _getPublicUrlOrPath() {
81
58
  const data = _interopRequireDefault(require("react-dev-utils/getPublicUrlOrPath"));
82
-
83
59
  _getPublicUrlOrPath = function () {
84
60
  return data;
85
61
  };
86
-
87
62
  return data;
88
63
  }
89
-
90
64
  function _utils() {
91
65
  const data = require("@teambit/legacy/dist/utils");
92
-
93
66
  _utils = function () {
94
67
  return data;
95
68
  };
96
-
97
69
  return data;
98
70
  }
99
-
100
71
  function _webpackFallbacks() {
101
72
  const data = require("./webpack-fallbacks");
102
-
103
73
  _webpackFallbacks = function () {
104
74
  return data;
105
75
  };
106
-
107
76
  return data;
108
77
  }
109
-
110
78
  function _html() {
111
79
  const data = require("./html");
112
-
113
80
  _html = function () {
114
81
  return data;
115
82
  };
116
-
117
83
  return data;
118
84
  }
119
-
120
85
  function _webpackBitReporterPlugin() {
121
86
  const data = require("../plugins/webpack-bit-reporter-plugin");
122
-
123
87
  _webpackBitReporterPlugin = function () {
124
88
  return data;
125
89
  };
126
-
127
90
  return data;
128
91
  }
129
-
130
92
  function _webpackFallbacksProvidePluginConfig() {
131
93
  const data = require("./webpack-fallbacks-provide-plugin-config");
132
-
133
94
  _webpackFallbacksProvidePluginConfig = function () {
134
95
  return data;
135
96
  };
136
-
137
97
  return data;
138
98
  }
139
-
140
99
  function _webpackFallbacksAliases() {
141
100
  const data = require("./webpack-fallbacks-aliases");
142
-
143
101
  _webpackFallbacksAliases = function () {
144
102
  return data;
145
103
  };
146
-
147
104
  return data;
148
105
  }
149
-
150
106
  const publicUrlOrPath = (0, _getPublicUrlOrPath().default)(process.env.NODE_ENV === 'development', '/', '/public');
151
-
152
107
  function configFactory(devServerID, workspaceDir, entryFiles, publicRoot, publicPath, pubsub, title, favicon) {
153
- const resolveWorkspacePath = relativePath => _path().default.resolve(workspaceDir, relativePath); // Required for babel-preset-react-app
154
-
108
+ const resolveWorkspacePath = relativePath => _path().default.resolve(workspaceDir, relativePath);
155
109
 
110
+ // Required for babel-preset-react-app
156
111
  process.env.NODE_ENV = 'development';
157
112
  const publicDirectory = `${publicRoot}/${publicPath}`;
158
113
  return {
@@ -167,14 +122,17 @@ function configFactory(devServerID, workspaceDir, entryFiles, publicRoot, public
167
122
  pathinfo: true,
168
123
  path: resolveWorkspacePath(publicDirectory),
169
124
  // publicPath: resolveWorkspacePath(publicDirectory),
125
+
170
126
  chunkFilename: 'static/js/[name].chunk.js',
171
127
  // point sourcemap entries to original disk locations (format as URL on windows)
172
- devtoolModuleFilenameTemplate: info => (0, _utils().pathNormalizeToLinux)(_path().default.resolve(info.absoluteResourcePath)) // this defaults to 'window', but by setting it to 'this' then
128
+ devtoolModuleFilenameTemplate: info => (0, _utils().pathNormalizeToLinux)(_path().default.resolve(info.absoluteResourcePath))
129
+
130
+ // this defaults to 'window', but by setting it to 'this' then
173
131
  // module chunks which are built will work in web workers as well.
174
132
  // Commented out to use the default (self) as according to tobias with webpack5 self is working with workers as well
175
133
  // globalObject: 'this',
176
-
177
134
  },
135
+
178
136
  infrastructureLogging: {
179
137
  level: 'error'
180
138
  },
@@ -208,33 +166,31 @@ function configFactory(devServerID, workspaceDir, entryFiles, publicRoot, public
208
166
  client: {
209
167
  overlay: false
210
168
  },
211
-
212
169
  onBeforeSetupMiddleware(wds) {
213
170
  const {
214
171
  app
215
- } = wds; // Keep `evalSourceMapMiddleware` and `errorOverlayMiddleware`
172
+ } = wds;
173
+ // Keep `evalSourceMapMiddleware` and `errorOverlayMiddleware`
216
174
  // middlewares before `redirectServedPath` otherwise will not have any effect
217
175
  // This lets us fetch source contents from webpack for the error overlay
218
176
  // @ts-ignore - @types/WDS mismatch - 3.11.6 vs 4.0.3
219
-
220
- app.use((0, _evalSourceMapMiddleware().default)(wds)); // This lets us open files from the runtime error overlay.
221
-
177
+ app.use((0, _evalSourceMapMiddleware().default)(wds));
178
+ // This lets us open files from the runtime error overlay.
222
179
  app.use((0, _errorOverlayMiddleware().default)());
223
180
  },
224
-
225
181
  onAfterSetupMiddleware({
226
182
  app
227
183
  }) {
228
184
  // Redirect to `PUBLIC_URL` or `homepage` from `package.json` if url not match
229
- app.use((0, _redirectServedPathMiddleware().default)(publicUrlOrPath)); // This service worker file is effectively a 'no-op' that will reset any
185
+ app.use((0, _redirectServedPathMiddleware().default)(publicUrlOrPath));
186
+
187
+ // This service worker file is effectively a 'no-op' that will reset any
230
188
  // previous service worker registered for the same host:port combination.
231
189
  // We do this in development to avoid hitting the production cache if
232
190
  // it used the same host and port.
233
191
  // https://github.com/facebook/create-react-app/issues/2272#issuecomment-302832432
234
-
235
192
  app.use((0, _noopServiceWorkerMiddleware().default)(publicUrlOrPath));
236
193
  },
237
-
238
194
  devMiddleware: {
239
195
  // forward static files
240
196
  publicPath: _path().default.join('/', publicRoot)