@rspack/core 1.4.7-alpha.1 → 1.4.8

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 (99) hide show
  1. package/compiled/glob-to-regexp/index.d.ts +11 -0
  2. package/compiled/glob-to-regexp/index.js +187 -0
  3. package/compiled/glob-to-regexp/package.json +1 -0
  4. package/compiled/watchpack/index.js +9 -149
  5. package/dist/Compilation.d.ts +13 -7
  6. package/dist/Compiler.d.ts +10 -10
  7. package/dist/MultiCompiler.d.ts +1 -1
  8. package/dist/NativeWatchFileSystem.d.ts +17 -0
  9. package/dist/NormalModule.d.ts +1 -1
  10. package/dist/ResolverFactory.d.ts +1 -1
  11. package/dist/Watching.d.ts +10 -1
  12. package/dist/builtin-loader/swc/index.d.ts +3 -3
  13. package/dist/builtin-plugin/APIPlugin.d.ts +1 -1
  14. package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +1 -1
  15. package/dist/builtin-plugin/AssetModulesPlugin.d.ts +1 -1
  16. package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +1 -1
  17. package/dist/builtin-plugin/BannerPlugin.d.ts +1 -1
  18. package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -1
  19. package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +1 -1
  20. package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +1 -1
  21. package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +1 -1
  22. package/dist/builtin-plugin/CopyRspackPlugin.d.ts +1 -1
  23. package/dist/builtin-plugin/CssChunkingPlugin.d.ts +1 -1
  24. package/dist/builtin-plugin/CssModulesPlugin.d.ts +1 -1
  25. package/dist/builtin-plugin/DataUriPlugin.d.ts +1 -1
  26. package/dist/builtin-plugin/DefinePlugin.d.ts +1 -1
  27. package/dist/builtin-plugin/DllEntryPlugin.d.ts +1 -1
  28. package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +1 -1
  29. package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +1 -1
  30. package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -1
  31. package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +1 -1
  32. package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +1 -1
  33. package/dist/builtin-plugin/EntryPlugin.d.ts +1 -1
  34. package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +1 -1
  35. package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +1 -1
  36. package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +1 -1
  37. package/dist/builtin-plugin/FileUriPlugin.d.ts +1 -1
  38. package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +1 -1
  39. package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +1 -1
  40. package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +1 -1
  41. package/dist/builtin-plugin/IgnorePlugin.d.ts +1 -1
  42. package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +1 -1
  43. package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
  44. package/dist/builtin-plugin/JsonModulesPlugin.d.ts +1 -1
  45. package/dist/builtin-plugin/LibManifestPlugin.d.ts +1 -1
  46. package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +1 -1
  47. package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +1 -1
  48. package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +1 -1
  49. package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +1 -1
  50. package/dist/builtin-plugin/ModuleInfoHeaderPlugin.d.ts +1 -1
  51. package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +1 -1
  52. package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +1 -1
  53. package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +1 -1
  54. package/dist/builtin-plugin/NodeTargetPlugin.d.ts +1 -1
  55. package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +1 -1
  56. package/dist/builtin-plugin/ProgressPlugin.d.ts +1 -1
  57. package/dist/builtin-plugin/ProvidePlugin.d.ts +1 -1
  58. package/dist/builtin-plugin/RealContentHashPlugin.d.ts +1 -1
  59. package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +1 -1
  60. package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +1 -1
  61. package/dist/builtin-plugin/RsdoctorPlugin.d.ts +1 -1
  62. package/dist/builtin-plugin/RslibPlugin.d.ts +1 -1
  63. package/dist/builtin-plugin/RstestPlugin.d.ts +1 -1
  64. package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +1 -1
  65. package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
  66. package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +1 -1
  67. package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +1 -1
  68. package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +1 -1
  69. package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +1 -1
  70. package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +1 -1
  71. package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +1 -1
  72. package/dist/builtin-plugin/base.d.ts +2 -2
  73. package/dist/builtin-plugin/html-plugin/index.d.ts +1 -1
  74. package/dist/builtin-plugin/html-plugin/plugin.d.ts +1 -1
  75. package/dist/builtin-plugin/index.d.ts +20 -20
  76. package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +1 -1
  77. package/dist/config/adapterRuleUse.d.ts +2 -2
  78. package/dist/config/devServer.d.ts +1 -1
  79. package/dist/config/normalization.d.ts +3 -2
  80. package/dist/config/types.d.ts +8 -3
  81. package/dist/container/ContainerPlugin.d.ts +1 -1
  82. package/dist/container/ContainerReferencePlugin.d.ts +1 -1
  83. package/dist/container/ModuleFederationRuntimePlugin.d.ts +1 -1
  84. package/dist/exports.d.ts +22 -62
  85. package/dist/index.js +6762 -6666
  86. package/dist/lib/Cache.d.ts +1 -1
  87. package/dist/lib/CacheFacade.d.ts +1 -1
  88. package/dist/loader-runner/utils.d.ts +1 -1
  89. package/dist/node/NodeWatchFileSystem.d.ts +1 -1
  90. package/dist/rspack.d.ts +1 -1
  91. package/dist/schema/config.d.ts +50 -49
  92. package/dist/schema/plugins.d.ts +7 -7
  93. package/dist/sharing/ConsumeSharedPlugin.d.ts +1 -1
  94. package/dist/sharing/ProvideSharedPlugin.d.ts +1 -1
  95. package/dist/sharing/ShareRuntimePlugin.d.ts +1 -1
  96. package/dist/util/fs.d.ts +10 -1
  97. package/hot/lazy-compilation-node.js +0 -2
  98. package/hot/lazy-compilation-web.js +0 -2
  99. package/package.json +4 -2
@@ -0,0 +1,11 @@
1
+ declare function GlobToRegExp(glob: string, options?: GlobToRegExp.Options): RegExp;
2
+
3
+ declare namespace GlobToRegExp {
4
+ interface Options {
5
+ extended?: boolean | undefined;
6
+ globstar?: boolean | undefined;
7
+ flags?: string | undefined;
8
+ }
9
+ }
10
+
11
+ export { GlobToRegExp as default };
@@ -0,0 +1,187 @@
1
+ /******/ (() => { // webpackBootstrap
2
+ /******/ var __webpack_modules__ = ({
3
+
4
+ /***/ 137:
5
+ /***/ ((module) => {
6
+
7
+ module.exports = function (glob, opts) {
8
+ if (typeof glob !== 'string') {
9
+ throw new TypeError('Expected a string');
10
+ }
11
+
12
+ var str = String(glob);
13
+
14
+ // The regexp we are building, as a string.
15
+ var reStr = "";
16
+
17
+ // Whether we are matching so called "extended" globs (like bash) and should
18
+ // support single character matching, matching ranges of characters, group
19
+ // matching, etc.
20
+ var extended = opts ? !!opts.extended : false;
21
+
22
+ // When globstar is _false_ (default), '/foo/*' is translated a regexp like
23
+ // '^\/foo\/.*$' which will match any string beginning with '/foo/'
24
+ // When globstar is _true_, '/foo/*' is translated to regexp like
25
+ // '^\/foo\/[^/]*$' which will match any string beginning with '/foo/' BUT
26
+ // which does not have a '/' to the right of it.
27
+ // E.g. with '/foo/*' these will match: '/foo/bar', '/foo/bar.txt' but
28
+ // these will not '/foo/bar/baz', '/foo/bar/baz.txt'
29
+ // Lastely, when globstar is _true_, '/foo/**' is equivelant to '/foo/*' when
30
+ // globstar is _false_
31
+ var globstar = opts ? !!opts.globstar : false;
32
+
33
+ // If we are doing extended matching, this boolean is true when we are inside
34
+ // a group (eg {*.html,*.js}), and false otherwise.
35
+ var inGroup = false;
36
+
37
+ // RegExp flags (eg "i" ) to pass in to RegExp constructor.
38
+ var flags = opts && typeof( opts.flags ) === "string" ? opts.flags : "";
39
+
40
+ var c;
41
+ for (var i = 0, len = str.length; i < len; i++) {
42
+ c = str[i];
43
+
44
+ switch (c) {
45
+ case "/":
46
+ case "$":
47
+ case "^":
48
+ case "+":
49
+ case ".":
50
+ case "(":
51
+ case ")":
52
+ case "=":
53
+ case "!":
54
+ case "|":
55
+ reStr += "\\" + c;
56
+ break;
57
+
58
+ case "?":
59
+ if (extended) {
60
+ reStr += ".";
61
+ break;
62
+ }
63
+
64
+ case "[":
65
+ case "]":
66
+ if (extended) {
67
+ reStr += c;
68
+ break;
69
+ }
70
+
71
+ case "{":
72
+ if (extended) {
73
+ inGroup = true;
74
+ reStr += "(";
75
+ break;
76
+ }
77
+
78
+ case "}":
79
+ if (extended) {
80
+ inGroup = false;
81
+ reStr += ")";
82
+ break;
83
+ }
84
+
85
+ case ",":
86
+ if (inGroup) {
87
+ reStr += "|";
88
+ break;
89
+ }
90
+ reStr += "\\" + c;
91
+ break;
92
+
93
+ case "*":
94
+ // Move over all consecutive "*"'s.
95
+ // Also store the previous and next characters
96
+ var prevChar = str[i - 1];
97
+ var starCount = 1;
98
+ while(str[i + 1] === "*") {
99
+ starCount++;
100
+ i++;
101
+ }
102
+ var nextChar = str[i + 1];
103
+
104
+ if (!globstar) {
105
+ // globstar is disabled, so treat any number of "*" as one
106
+ reStr += ".*";
107
+ } else {
108
+ // globstar is enabled, so determine if this is a globstar segment
109
+ var isGlobstar = starCount > 1 // multiple "*"'s
110
+ && (prevChar === "/" || prevChar === undefined) // from the start of the segment
111
+ && (nextChar === "/" || nextChar === undefined) // to the end of the segment
112
+
113
+ if (isGlobstar) {
114
+ // it's a globstar, so match zero or more path segments
115
+ reStr += "((?:[^/]*(?:\/|$))*)";
116
+ i++; // move over the "/"
117
+ } else {
118
+ // it's not a globstar, so only match one path segment
119
+ reStr += "([^/]*)";
120
+ }
121
+ }
122
+ break;
123
+
124
+ default:
125
+ reStr += c;
126
+ }
127
+ }
128
+
129
+ // When regexp 'g' flag is specified don't
130
+ // constrain the regular expression with ^ & $
131
+ if (!flags || !~flags.indexOf('g')) {
132
+ reStr = "^" + reStr + "$";
133
+ }
134
+
135
+ return new RegExp(reStr, flags);
136
+ };
137
+
138
+
139
+ /***/ })
140
+
141
+ /******/ });
142
+ /************************************************************************/
143
+ /******/ // The module cache
144
+ /******/ var __webpack_module_cache__ = {};
145
+ /******/
146
+ /******/ // The require function
147
+ /******/ function __nccwpck_require__(moduleId) {
148
+ /******/ // Check if module is in cache
149
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
150
+ /******/ if (cachedModule !== undefined) {
151
+ /******/ return cachedModule.exports;
152
+ /******/ }
153
+ /******/ // Create a new module (and put it into the cache)
154
+ /******/ var module = __webpack_module_cache__[moduleId] = {
155
+ /******/ // no module.id needed
156
+ /******/ // no module.loaded needed
157
+ /******/ exports: {}
158
+ /******/ };
159
+ /******/
160
+ /******/ // Execute the module function
161
+ /******/ var threw = true;
162
+ /******/ try {
163
+ /******/ __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__);
164
+ /******/ threw = false;
165
+ /******/ } finally {
166
+ /******/ if(threw) delete __webpack_module_cache__[moduleId];
167
+ /******/ }
168
+ /******/
169
+ /******/ // Return the exports of the module
170
+ /******/ return module.exports;
171
+ /******/ }
172
+ /******/
173
+ /************************************************************************/
174
+ /******/ /* webpack/runtime/compat */
175
+ /******/
176
+ /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
177
+ /******/
178
+ /************************************************************************/
179
+ /******/
180
+ /******/ // startup
181
+ /******/ // Load entry module and return exports
182
+ /******/ // This entry module is referenced by other modules so it can't be inlined
183
+ /******/ var __webpack_exports__ = __nccwpck_require__(137);
184
+ /******/ module.exports = __webpack_exports__;
185
+ /******/
186
+ /******/ })()
187
+ ;
@@ -0,0 +1 @@
1
+ {"name":"glob-to-regexp","author":"Nick Fitzgerald <fitzgen@gmail.com>","version":"0.4.1","license":"BSD-2-Clause","types":"index.d.ts","type":"commonjs"}
@@ -1,147 +1,10 @@
1
1
  /******/ (() => { // webpackBootstrap
2
+ /******/ "use strict";
2
3
  /******/ var __webpack_modules__ = ({
3
4
 
4
- /***/ 137:
5
- /***/ ((module) => {
6
-
7
- module.exports = function (glob, opts) {
8
- if (typeof glob !== 'string') {
9
- throw new TypeError('Expected a string');
10
- }
11
-
12
- var str = String(glob);
13
-
14
- // The regexp we are building, as a string.
15
- var reStr = "";
16
-
17
- // Whether we are matching so called "extended" globs (like bash) and should
18
- // support single character matching, matching ranges of characters, group
19
- // matching, etc.
20
- var extended = opts ? !!opts.extended : false;
21
-
22
- // When globstar is _false_ (default), '/foo/*' is translated a regexp like
23
- // '^\/foo\/.*$' which will match any string beginning with '/foo/'
24
- // When globstar is _true_, '/foo/*' is translated to regexp like
25
- // '^\/foo\/[^/]*$' which will match any string beginning with '/foo/' BUT
26
- // which does not have a '/' to the right of it.
27
- // E.g. with '/foo/*' these will match: '/foo/bar', '/foo/bar.txt' but
28
- // these will not '/foo/bar/baz', '/foo/bar/baz.txt'
29
- // Lastely, when globstar is _true_, '/foo/**' is equivelant to '/foo/*' when
30
- // globstar is _false_
31
- var globstar = opts ? !!opts.globstar : false;
32
-
33
- // If we are doing extended matching, this boolean is true when we are inside
34
- // a group (eg {*.html,*.js}), and false otherwise.
35
- var inGroup = false;
36
-
37
- // RegExp flags (eg "i" ) to pass in to RegExp constructor.
38
- var flags = opts && typeof( opts.flags ) === "string" ? opts.flags : "";
39
-
40
- var c;
41
- for (var i = 0, len = str.length; i < len; i++) {
42
- c = str[i];
43
-
44
- switch (c) {
45
- case "/":
46
- case "$":
47
- case "^":
48
- case "+":
49
- case ".":
50
- case "(":
51
- case ")":
52
- case "=":
53
- case "!":
54
- case "|":
55
- reStr += "\\" + c;
56
- break;
57
-
58
- case "?":
59
- if (extended) {
60
- reStr += ".";
61
- break;
62
- }
63
-
64
- case "[":
65
- case "]":
66
- if (extended) {
67
- reStr += c;
68
- break;
69
- }
70
-
71
- case "{":
72
- if (extended) {
73
- inGroup = true;
74
- reStr += "(";
75
- break;
76
- }
77
-
78
- case "}":
79
- if (extended) {
80
- inGroup = false;
81
- reStr += ")";
82
- break;
83
- }
84
-
85
- case ",":
86
- if (inGroup) {
87
- reStr += "|";
88
- break;
89
- }
90
- reStr += "\\" + c;
91
- break;
92
-
93
- case "*":
94
- // Move over all consecutive "*"'s.
95
- // Also store the previous and next characters
96
- var prevChar = str[i - 1];
97
- var starCount = 1;
98
- while(str[i + 1] === "*") {
99
- starCount++;
100
- i++;
101
- }
102
- var nextChar = str[i + 1];
103
-
104
- if (!globstar) {
105
- // globstar is disabled, so treat any number of "*" as one
106
- reStr += ".*";
107
- } else {
108
- // globstar is enabled, so determine if this is a globstar segment
109
- var isGlobstar = starCount > 1 // multiple "*"'s
110
- && (prevChar === "/" || prevChar === undefined) // from the start of the segment
111
- && (nextChar === "/" || nextChar === undefined) // to the end of the segment
112
-
113
- if (isGlobstar) {
114
- // it's a globstar, so match zero or more path segments
115
- reStr += "((?:[^/]*(?:\/|$))*)";
116
- i++; // move over the "/"
117
- } else {
118
- // it's not a globstar, so only match one path segment
119
- reStr += "([^/]*)";
120
- }
121
- }
122
- break;
123
-
124
- default:
125
- reStr += c;
126
- }
127
- }
128
-
129
- // When regexp 'g' flag is specified don't
130
- // constrain the regular expression with ^ & $
131
- if (!flags || !~flags.indexOf('g')) {
132
- reStr = "^" + reStr + "$";
133
- }
134
-
135
- return new RegExp(reStr, flags);
136
- };
137
-
138
-
139
- /***/ }),
140
-
141
5
  /***/ 799:
142
6
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
143
7
 
144
- "use strict";
145
8
  /*
146
9
  MIT License http://www.opensource.org/licenses/mit-license.php
147
10
  Author Tobias Koppers @sokra
@@ -940,7 +803,6 @@ function ensureFsAccuracy(mtime) {
940
803
  /***/ 308:
941
804
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
942
805
 
943
- "use strict";
944
806
  /*
945
807
  MIT License http://www.opensource.org/licenses/mit-license.php
946
808
  Author Tobias Koppers @sokra
@@ -1055,7 +917,6 @@ module.exports = LinkResolver;
1055
917
  /***/ 847:
1056
918
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1057
919
 
1058
- "use strict";
1059
920
  /*
1060
921
  MIT License http://www.opensource.org/licenses/mit-license.php
1061
922
  Author Tobias Koppers @sokra
@@ -1115,7 +976,6 @@ module.exports.WatcherManager = WatcherManager;
1115
976
  /***/ 935:
1116
977
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1117
978
 
1118
- "use strict";
1119
979
  /*
1120
980
  MIT License http://www.opensource.org/licenses/mit-license.php
1121
981
  Author Tobias Koppers @sokra
@@ -1261,7 +1121,6 @@ module.exports = (plan, limit) => {
1261
1121
  /***/ 214:
1262
1122
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
1263
1123
 
1264
- "use strict";
1265
1124
  /*
1266
1125
  MIT License http://www.opensource.org/licenses/mit-license.php
1267
1126
  Author Tobias Koppers @sokra
@@ -1640,7 +1499,6 @@ exports.watcherLimit = watcherLimit;
1640
1499
  /***/ 882:
1641
1500
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1642
1501
 
1643
- "use strict";
1644
1502
  /*
1645
1503
  MIT License http://www.opensource.org/licenses/mit-license.php
1646
1504
  Author Tobias Koppers @sokra
@@ -1650,7 +1508,7 @@ exports.watcherLimit = watcherLimit;
1650
1508
  const getWatcherManager = __nccwpck_require__(847);
1651
1509
  const LinkResolver = __nccwpck_require__(308);
1652
1510
  const EventEmitter = (__nccwpck_require__(434).EventEmitter);
1653
- const globToRegExp = __nccwpck_require__(137);
1511
+ const globToRegExp = __nccwpck_require__(686);
1654
1512
  const watchEventSource = __nccwpck_require__(214);
1655
1513
 
1656
1514
  const EMPTY_ARRAY = [];
@@ -2036,12 +1894,18 @@ class Watchpack extends EventEmitter {
2036
1894
  module.exports = Watchpack;
2037
1895
 
2038
1896
 
1897
+ /***/ }),
1898
+
1899
+ /***/ 686:
1900
+ /***/ ((module) => {
1901
+
1902
+ module.exports = require("../glob-to-regexp/index.js");
1903
+
2039
1904
  /***/ }),
2040
1905
 
2041
1906
  /***/ 923:
2042
1907
  /***/ ((module) => {
2043
1908
 
2044
- "use strict";
2045
1909
  module.exports = require("../graceful-fs/index.js");
2046
1910
 
2047
1911
  /***/ }),
@@ -2049,7 +1913,6 @@ module.exports = require("../graceful-fs/index.js");
2049
1913
  /***/ 434:
2050
1914
  /***/ ((module) => {
2051
1915
 
2052
- "use strict";
2053
1916
  module.exports = require("events");
2054
1917
 
2055
1918
  /***/ }),
@@ -2057,7 +1920,6 @@ module.exports = require("events");
2057
1920
  /***/ 896:
2058
1921
  /***/ ((module) => {
2059
1922
 
2060
- "use strict";
2061
1923
  module.exports = require("fs");
2062
1924
 
2063
1925
  /***/ }),
@@ -2065,7 +1927,6 @@ module.exports = require("fs");
2065
1927
  /***/ 857:
2066
1928
  /***/ ((module) => {
2067
1929
 
2068
- "use strict";
2069
1930
  module.exports = require("os");
2070
1931
 
2071
1932
  /***/ }),
@@ -2073,7 +1934,6 @@ module.exports = require("os");
2073
1934
  /***/ 928:
2074
1935
  /***/ ((module) => {
2075
1936
 
2076
- "use strict";
2077
1937
  module.exports = require("path");
2078
1938
 
2079
1939
  /***/ })
@@ -7,16 +7,20 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import * as binding from "@rspack/binding";
11
10
  import type { AssetInfo, ChunkGroup, Dependency, ExternalObject, JsCompilation, JsRuntimeModule } from "@rspack/binding";
11
+ import * as binding from "@rspack/binding";
12
12
  export type { AssetInfo } from "@rspack/binding";
13
13
  import * as liteTapable from "@rspack/lite-tapable";
14
14
  import type { Source } from "../compiled/webpack-sources";
15
+ import type { EntryOptions, EntryPlugin } from "./builtin-plugin";
15
16
  import type { Chunk } from "./Chunk";
16
17
  import type { ChunkGraph } from "./ChunkGraph";
17
18
  import type { Compiler } from "./Compiler";
18
19
  import type { ContextModuleFactory } from "./ContextModuleFactory";
20
+ import type { OutputNormalized, RspackOptionsNormalized, RspackPluginInstance, StatsOptions, StatsValue } from "./config";
19
21
  import type { Entrypoint } from "./Entrypoint";
22
+ import WebpackError from "./lib/WebpackError";
23
+ import { Logger } from "./logging/Logger";
20
24
  import type { Module } from "./Module";
21
25
  import ModuleGraph from "./ModuleGraph";
22
26
  import type { NormalModuleCompilationHooks } from "./NormalModule";
@@ -25,10 +29,6 @@ import type { ResolverFactory } from "./ResolverFactory";
25
29
  import type { RspackError } from "./RspackError";
26
30
  import { RuntimeModule } from "./RuntimeModule";
27
31
  import { Stats, type StatsAsset, type StatsError, type StatsModule } from "./Stats";
28
- import type { EntryOptions, EntryPlugin } from "./builtin-plugin";
29
- import type { OutputNormalized, RspackOptionsNormalized, RspackPluginInstance, StatsOptions, StatsValue } from "./config";
30
- import WebpackError from "./lib/WebpackError";
31
- import { Logger } from "./logging/Logger";
32
32
  import { StatsFactory } from "./stats/StatsFactory";
33
33
  import { StatsPrinter } from "./stats/StatsPrinter";
34
34
  import type { InputFileSystem } from "./util/fs";
@@ -228,7 +228,7 @@ export declare class Compilation {
228
228
  *
229
229
  * Note: This is a proxy for webpack internal API, only method `get`, `keys`, `values` and `entries` are supported now.
230
230
  */
231
- get namedChunkGroups(): ReadonlyMap<string, Readonly<binding.ChunkGroup>>;
231
+ get namedChunkGroups(): ReadonlyMap<string, Readonly<ChunkGroup>>;
232
232
  get modules(): ReadonlySet<Module>;
233
233
  get builtModules(): ReadonlySet<Module>;
234
234
  get chunks(): ReadonlySet<Chunk>;
@@ -296,6 +296,12 @@ export declare class Compilation {
296
296
  add: (dep: string) => void;
297
297
  addAll: (deps: Iterable<string>) => void;
298
298
  };
299
+ get __internal__addedFileDependencies(): string[];
300
+ get __internal__removedFileDependencies(): string[];
301
+ get __internal__addedContextDependencies(): string[];
302
+ get __internal__removedContextDependencies(): string[];
303
+ get __internal__addedMissingDependencies(): string[];
304
+ get __internal__removedMissingDependencies(): string[];
299
305
  contextDependencies: {
300
306
  [Symbol.iterator](): Generator<string, void, unknown>;
301
307
  has(dep: string): boolean;
@@ -367,7 +373,7 @@ export declare class Compilation {
367
373
  *
368
374
  * @internal
369
375
  */
370
- __internal_getInner(): binding.JsCompilation;
376
+ __internal_getInner(): JsCompilation;
371
377
  get __internal__shutdown(): boolean;
372
378
  set __internal__shutdown(shutdown: boolean);
373
379
  seal(): void;
@@ -9,24 +9,24 @@
9
9
  */
10
10
  import type * as binding from "@rspack/binding";
11
11
  import * as liteTapable from "@rspack/lite-tapable";
12
- import Cache from "./lib/Cache";
13
- import CacheFacade from "./lib/CacheFacade";
12
+ import type Watchpack from "../compiled/watchpack";
13
+ import type { Source } from "../compiled/webpack-sources";
14
14
  import type { Chunk } from "./Chunk";
15
+ import type { CompilationParams } from "./Compilation";
15
16
  import { Compilation } from "./Compilation";
16
17
  import { ContextModuleFactory } from "./ContextModuleFactory";
18
+ import type { EntryNormalized, OutputNormalized, RspackOptionsNormalized, RspackPluginInstance } from "./config";
19
+ import type { FileSystemInfoEntry } from "./FileSystemInfo";
20
+ import { rspack } from "./index";
21
+ import Cache from "./lib/Cache";
22
+ import CacheFacade from "./lib/CacheFacade";
23
+ import { Logger } from "./logging/Logger";
17
24
  import { NormalModuleFactory } from "./NormalModuleFactory";
18
25
  import { ResolverFactory } from "./ResolverFactory";
19
26
  import { RuleSetCompiler } from "./RuleSetCompiler";
20
27
  import { Stats } from "./Stats";
21
- import { Watching } from "./Watching";
22
- import { rspack } from "./index";
23
- import { Logger } from "./logging/Logger";
24
- import type Watchpack from "../compiled/watchpack";
25
- import type { Source } from "../compiled/webpack-sources";
26
- import type { CompilationParams } from "./Compilation";
27
- import type { FileSystemInfoEntry } from "./FileSystemInfo";
28
- import type { EntryNormalized, OutputNormalized, RspackOptionsNormalized, RspackPluginInstance } from "./config";
29
28
  import type { InputFileSystem, IntermediateFileSystem, OutputFileSystem, WatchFileSystem } from "./util/fs";
29
+ import { Watching } from "./Watching";
30
30
  export interface AssetEmittedInfo {
31
31
  content: Buffer;
32
32
  source: Source;
@@ -9,9 +9,9 @@
9
9
  */
10
10
  import * as liteTapable from "@rspack/lite-tapable";
11
11
  import type { CompilationParams, Compiler, RspackOptions } from ".";
12
+ import type { WatchOptions } from "./config";
12
13
  import MultiStats from "./MultiStats";
13
14
  import MultiWatching from "./MultiWatching";
14
- import type { WatchOptions } from "./config";
15
15
  import type { InputFileSystem, IntermediateFileSystem, WatchFileSystem } from "./util/fs";
16
16
  export interface MultiCompilerOptions {
17
17
  /**
@@ -0,0 +1,17 @@
1
+ import * as binding from "@rspack/binding";
2
+ import type Watchpack from "../compiled/watchpack";
3
+ import type { FileSystemInfoEntry, Watcher, WatchFileSystem } from "./util/fs";
4
+ export default class NativeWatchFileSystem implements WatchFileSystem {
5
+ #private;
6
+ watch(files: Iterable<string> & {
7
+ added?: Iterable<string>;
8
+ removed?: Iterable<string>;
9
+ }, directories: Iterable<string> & {
10
+ added?: Iterable<string>;
11
+ removed?: Iterable<string>;
12
+ }, missing: Iterable<string> & {
13
+ added?: Iterable<string>;
14
+ removed?: Iterable<string>;
15
+ }, _startTime: number, options: Watchpack.WatchOptions, callback: (error: Error | null, fileTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">, contextTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">, changedFiles: Set<string>, removedFiles: Set<string>) => void, callbackUndelayed: (fileName: string, changeTime: number) => void): Watcher;
16
+ getNativeWatcher(options: Watchpack.WatchOptions): binding.NativeWatcher;
17
+ }
@@ -1,7 +1,7 @@
1
1
  import * as liteTapable from "@rspack/lite-tapable";
2
2
  import type { Compilation } from "./Compilation";
3
- import type { Module } from "./Module";
4
3
  import type { LoaderContext } from "./config";
4
+ import type { Module } from "./Module";
5
5
  export interface NormalModuleCompilationHooks {
6
6
  loader: liteTapable.SyncHook<[LoaderContext, Module]>;
7
7
  readResourceForScheme: any;
@@ -1,6 +1,6 @@
1
1
  import * as binding from "@rspack/binding";
2
- import { Resolver } from "./Resolver";
3
2
  import { type Resolve } from "./config";
3
+ import { Resolver } from "./Resolver";
4
4
  type ResolveOptionsWithDependencyType = Resolve & {
5
5
  dependencyCategory?: string;
6
6
  resolveToContext?: boolean;
@@ -21,7 +21,16 @@ export declare class Watching {
21
21
  startTime?: number;
22
22
  suspended: boolean;
23
23
  constructor(compiler: Compiler, watchOptions: WatchOptions, handler: Callback<Error, Stats>);
24
- watch(files: Iterable<string>, dirs: Iterable<string>, missing: Iterable<string>): void;
24
+ watch(files: Iterable<string> & {
25
+ added?: Iterable<string>;
26
+ removed?: Iterable<string>;
27
+ }, dirs: Iterable<string> & {
28
+ added?: Iterable<string>;
29
+ removed?: Iterable<string>;
30
+ }, missing: Iterable<string> & {
31
+ added?: Iterable<string>;
32
+ removed?: Iterable<string>;
33
+ }): void;
25
34
  close(callback?: () => void): void;
26
35
  invalidate(callback?: Callback<Error, void>): void;
27
36
  /**
@@ -1,5 +1,5 @@
1
- export { resolvePluginImport } from "./pluginImport";
2
- export type { PluginImportOptions } from "./pluginImport";
3
- export { resolveCollectTypeScriptInfo } from "./collectTypeScriptInfo";
4
1
  export type { CollectTypeScriptInfoOptions } from "./collectTypeScriptInfo";
2
+ export { resolveCollectTypeScriptInfo } from "./collectTypeScriptInfo";
3
+ export type { PluginImportOptions } from "./pluginImport";
4
+ export { resolvePluginImport } from "./pluginImport";
5
5
  export type { SwcLoaderEnvConfig, SwcLoaderEsParserConfig, SwcLoaderJscConfig, SwcLoaderModuleConfig, SwcLoaderOptions, SwcLoaderParserConfig, SwcLoaderTransformConfig, SwcLoaderTsParserConfig } from "./types";
@@ -2,7 +2,7 @@ export declare const APIPlugin: {
2
2
  new (): {
3
3
  name: string;
4
4
  _args: [];
5
- affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
5
+ affectedHooks: "done" | "compilation" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
6
6
  raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
7
7
  apply(compiler: import("..").Compiler): void;
8
8
  };
@@ -2,7 +2,7 @@ export declare const ArrayPushCallbackChunkFormatPlugin: {
2
2
  new (): {
3
3
  name: string;
4
4
  _args: [];
5
- affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
5
+ affectedHooks: "done" | "compilation" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
6
6
  raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
7
7
  apply(compiler: import("..").Compiler): void;
8
8
  };
@@ -2,7 +2,7 @@ export declare const AssetModulesPlugin: {
2
2
  new (): {
3
3
  name: string;
4
4
  _args: [];
5
- affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
5
+ affectedHooks: "done" | "compilation" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
6
6
  raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
7
7
  apply(compiler: import("..").Compiler): void;
8
8
  };