@teambit/webpack 0.0.880 → 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.
- package/dist/config/html.js +2 -2
- package/dist/config/html.js.map +1 -1
- package/dist/config/webpack-fallbacks-aliases.js.map +1 -1
- package/dist/config/webpack-fallbacks-provide-plugin-config.js.map +1 -1
- package/dist/config/webpack-fallbacks.js +7 -28
- package/dist/config/webpack-fallbacks.js.map +1 -1
- package/dist/config/webpack.config.js +1 -45
- package/dist/config/webpack.config.js.map +1 -1
- package/dist/config/webpack.dev.config.js +14 -58
- package/dist/config/webpack.dev.config.js.map +1 -1
- package/dist/events/index.js +0 -4
- package/dist/events/index.js.map +1 -1
- package/dist/events/webpack-compilation-done-event.js +1 -12
- package/dist/events/webpack-compilation-done-event.js.map +1 -1
- package/dist/events/webpack-compilation-started-event.js +1 -10
- package/dist/events/webpack-compilation-started-event.js.map +1 -1
- package/dist/index.js +0 -35
- package/dist/index.js.map +1 -1
- package/dist/plugins/webpack-bit-reporter-plugin.js +4 -16
- package/dist/plugins/webpack-bit-reporter-plugin.js.map +1 -1
- package/dist/transformers/get-exposed-rules.js +0 -18
- package/dist/transformers/get-exposed-rules.js.map +1 -1
- package/dist/transformers/get-externals.js +0 -10
- package/dist/transformers/get-externals.js.map +1 -1
- package/dist/transformers/index.js +0 -9
- package/dist/transformers/index.js.map +1 -1
- package/dist/transformers/inject-body.js +0 -5
- package/dist/transformers/inject-body.js.map +1 -1
- package/dist/transformers/inject-head.js +0 -4
- package/dist/transformers/inject-head.js.map +1 -1
- package/dist/transformers/resolve-peer.js +2 -22
- package/dist/transformers/resolve-peer.js.map +1 -1
- package/dist/transformers/transformers.js +5 -20
- package/dist/transformers/transformers.js.map +1 -1
- package/dist/webpack.aspect.js +0 -5
- package/dist/webpack.aspect.js.map +1 -1
- package/dist/webpack.bundler.js +2 -33
- package/dist/webpack.bundler.js.map +1 -1
- package/dist/webpack.composition.js +0 -6
- package/dist/webpack.composition.js.map +1 -1
- package/dist/webpack.dev-server.js +8 -25
- package/dist/webpack.dev-server.js.map +1 -1
- package/dist/webpack.main.runtime.js +9 -74
- package/dist/webpack.main.runtime.js.map +1 -1
- package/package-tar/teambit-webpack-0.0.882.tgz +0 -0
- package/package.json +8 -8
- package/{preview-1666312873430.js → preview-1666496165706.js} +2 -2
- package/package-tar/teambit-webpack-0.0.880.tgz +0 -0
package/dist/config/html.js
CHANGED
|
@@ -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
|
-
}
|
|
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
|
package/dist/config/html.js.map
CHANGED
|
@@ -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":"
|
|
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,
|
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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":"
|
|
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,OA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AO,CAAC;AACjD,MAAMmB,cAAc,GAAGpB,OAAO,CAACC,OAAO,CAAC,eAAe,CAAC;AACvD,MAAMoB,gBAAgB,GAAGrB,OAAO,CAACC,OAAO,CAAC,iBAAiB,CAAC;AAEpD,MAAMqB,SAAS,GAAG;EACvBC,MAAM,EAAExB,kBAAkB;EAC1ByB,MAAM,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":"
|
|
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;IAAA;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AC;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);
|
|
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))
|
|
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;
|
|
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
|
-
|
|
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));
|
|
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)
|