@rspack/dev-server 0.0.0-0074001a71-20230224065505

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 (108) hide show
  1. package/CHANGELOG.md +234 -0
  2. package/LICENSE +22 -0
  3. package/README.md +16 -0
  4. package/dist/config.d.ts +25 -0
  5. package/dist/config.d.ts.map +1 -0
  6. package/dist/config.js +3 -0
  7. package/dist/config.js.map +1 -0
  8. package/dist/index.d.ts +2 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.js +6 -0
  11. package/dist/index.js.map +1 -0
  12. package/dist/reload.d.ts +9 -0
  13. package/dist/reload.d.ts.map +1 -0
  14. package/dist/reload.js +23 -0
  15. package/dist/reload.js.map +1 -0
  16. package/dist/server.d.ts +28 -0
  17. package/dist/server.d.ts.map +1 -0
  18. package/dist/server.js +401 -0
  19. package/dist/server.js.map +1 -0
  20. package/jest.config.js +10 -0
  21. package/package.json +40 -0
  22. package/src/config.ts +27 -0
  23. package/src/index.ts +1 -0
  24. package/src/reload.ts +31 -0
  25. package/src/server.ts +474 -0
  26. package/tests/__snapshots__/normalizeOptions.test.ts.snap +232 -0
  27. package/tests/e2e/hot-reaload.test.ts +115 -0
  28. package/tests/e2e-fixtures/react/app.jsx +14 -0
  29. package/tests/e2e-fixtures/react/index.css +3 -0
  30. package/tests/e2e-fixtures/react/index.html +12 -0
  31. package/tests/e2e-fixtures/react/index.jsx +6 -0
  32. package/tests/e2e-fixtures/react/node_modules/react/LICENSE +21 -0
  33. package/tests/e2e-fixtures/react/node_modules/react/README.md +37 -0
  34. package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-dev-runtime.development.js +1296 -0
  35. package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-dev-runtime.production.min.js +10 -0
  36. package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-dev-runtime.profiling.min.js +10 -0
  37. package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-runtime.development.js +1314 -0
  38. package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-runtime.production.min.js +11 -0
  39. package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-runtime.profiling.min.js +11 -0
  40. package/tests/e2e-fixtures/react/node_modules/react/cjs/react.development.js +2739 -0
  41. package/tests/e2e-fixtures/react/node_modules/react/cjs/react.production.min.js +26 -0
  42. package/tests/e2e-fixtures/react/node_modules/react/cjs/react.shared-subset.development.js +20 -0
  43. package/tests/e2e-fixtures/react/node_modules/react/cjs/react.shared-subset.production.min.js +10 -0
  44. package/tests/e2e-fixtures/react/node_modules/react/index.js +7 -0
  45. package/tests/e2e-fixtures/react/node_modules/react/jsx-dev-runtime.js +7 -0
  46. package/tests/e2e-fixtures/react/node_modules/react/jsx-runtime.js +7 -0
  47. package/tests/e2e-fixtures/react/node_modules/react/package.json +47 -0
  48. package/tests/e2e-fixtures/react/node_modules/react/react.shared-subset.js +7 -0
  49. package/tests/e2e-fixtures/react/node_modules/react/umd/react.development.js +3342 -0
  50. package/tests/e2e-fixtures/react/node_modules/react/umd/react.production.min.js +31 -0
  51. package/tests/e2e-fixtures/react/node_modules/react/umd/react.profiling.min.js +31 -0
  52. package/tests/e2e-fixtures/react/node_modules/react-dom/LICENSE +21 -0
  53. package/tests/e2e-fixtures/react/node_modules/react-dom/README.md +60 -0
  54. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js +7018 -0
  55. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +93 -0
  56. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server-legacy.node.development.js +7078 -0
  57. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server-legacy.node.production.min.js +101 -0
  58. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server.browser.development.js +7003 -0
  59. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js +96 -0
  60. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server.node.development.js +7059 -0
  61. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server.node.production.min.js +102 -0
  62. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-test-utils.development.js +1741 -0
  63. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-test-utils.production.min.js +40 -0
  64. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom.development.js +29868 -0
  65. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom.production.min.js +323 -0
  66. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom.profiling.min.js +367 -0
  67. package/tests/e2e-fixtures/react/node_modules/react-dom/client.js +25 -0
  68. package/tests/e2e-fixtures/react/node_modules/react-dom/index.js +38 -0
  69. package/tests/e2e-fixtures/react/node_modules/react-dom/package.json +62 -0
  70. package/tests/e2e-fixtures/react/node_modules/react-dom/profiling.js +38 -0
  71. package/tests/e2e-fixtures/react/node_modules/react-dom/server.browser.js +17 -0
  72. package/tests/e2e-fixtures/react/node_modules/react-dom/server.js +3 -0
  73. package/tests/e2e-fixtures/react/node_modules/react-dom/server.node.js +17 -0
  74. package/tests/e2e-fixtures/react/node_modules/react-dom/test-utils.js +7 -0
  75. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-server-legacy.browser.development.js +7015 -0
  76. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-server-legacy.browser.production.min.js +75 -0
  77. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-server.browser.development.js +7000 -0
  78. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-server.browser.production.min.js +76 -0
  79. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-test-utils.development.js +1737 -0
  80. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-test-utils.production.min.js +33 -0
  81. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom.development.js +29869 -0
  82. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom.production.min.js +267 -0
  83. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom.profiling.min.js +285 -0
  84. package/tests/e2e-fixtures/react/node_modules/scheduler/LICENSE +21 -0
  85. package/tests/e2e-fixtures/react/node_modules/scheduler/README.md +9 -0
  86. package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler-unstable_mock.development.js +700 -0
  87. package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler-unstable_mock.production.min.js +20 -0
  88. package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler-unstable_post_task.development.js +207 -0
  89. package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler-unstable_post_task.production.min.js +14 -0
  90. package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler.development.js +634 -0
  91. package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler.production.min.js +19 -0
  92. package/tests/e2e-fixtures/react/node_modules/scheduler/index.js +7 -0
  93. package/tests/e2e-fixtures/react/node_modules/scheduler/package.json +36 -0
  94. package/tests/e2e-fixtures/react/node_modules/scheduler/umd/scheduler-unstable_mock.development.js +699 -0
  95. package/tests/e2e-fixtures/react/node_modules/scheduler/umd/scheduler-unstable_mock.production.min.js +19 -0
  96. package/tests/e2e-fixtures/react/node_modules/scheduler/umd/scheduler.development.js +152 -0
  97. package/tests/e2e-fixtures/react/node_modules/scheduler/umd/scheduler.production.min.js +146 -0
  98. package/tests/e2e-fixtures/react/node_modules/scheduler/umd/scheduler.profiling.min.js +146 -0
  99. package/tests/e2e-fixtures/react/node_modules/scheduler/unstable_mock.js +7 -0
  100. package/tests/e2e-fixtures/react/node_modules/scheduler/unstable_post_task.js +7 -0
  101. package/tests/e2e-fixtures/react/package.json +8 -0
  102. package/tests/e2e-fixtures/react/webpack.config.js +26 -0
  103. package/tests/helpers/emitFile.ts +69 -0
  104. package/tests/helpers/runBrowser.ts +85 -0
  105. package/tests/helpers/tempDir.ts +58 -0
  106. package/tests/normalizeOptions.test.ts +107 -0
  107. package/tsconfig.json +15 -0
  108. package/tsconfig.tsbuildinfo +1 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,234 @@
1
+ # rspack-dev-server
2
+
3
+ ## 0.0.0-0074001a71-20230224065505
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [3cc27e32ac]
8
+ - Updated dependencies [a22149e98a]
9
+ - @rspack/core@0.0.0-0074001a71-20230224065505
10
+ - @rspack/dev-middleware@0.0.0-0074001a71-20230224065505
11
+ - @rspack/dev-server@0.0.0-0074001a71-20230224065505
12
+ - @rspack/dev-client@0.0.0-0074001a71-20230224065505
13
+
14
+ ## 0.0.23
15
+
16
+ ### Patch Changes
17
+
18
+ - b67418968: chore: 🤖 use module path instead of module id in diagnositc
19
+ - 962f8a251: fix: should create different module with different module rule
20
+ - 1c7ab6dfd: feat: rspack-cli and devServer support multiCompiler
21
+ - 766c94042: fix rust test
22
+ - 035c15953: basic implementation of compilation.hooks.optimizeChunkModules
23
+ - 82aa28d6b: feat: add copy-plugin
24
+ - c1f19b817: align webpack config optimization.sideEffects
25
+ - Updated dependencies [b67418968]
26
+ - Updated dependencies [962f8a251]
27
+ - Updated dependencies [1c7ab6dfd]
28
+ - Updated dependencies [766c94042]
29
+ - Updated dependencies [035c15953]
30
+ - Updated dependencies [82aa28d6b]
31
+ - Updated dependencies [60fb4c5bf]
32
+ - Updated dependencies [c1f19b817]
33
+ - @rspack/dev-client@0.0.23
34
+ - @rspack/dev-middleware@0.0.23
35
+ - @rspack/dev-server@0.0.23
36
+
37
+ ## 0.0.22
38
+
39
+ ### Patch Changes
40
+
41
+ - 59edc2cb4: fix watch options
42
+ - ac02a096e: fix: getRspackMemoryAssets failed to get index.html when request path is /
43
+ feat: extends webpack-dev-server
44
+ - 290bf7fb5: feat: add devServer.historyApiFallback options
45
+ - d88ffa666: feat: support devServer.client.webSocketUrl
46
+ - Updated dependencies [ce31cd029]
47
+ - Updated dependencies [59edc2cb4]
48
+ - Updated dependencies [ac02a096e]
49
+ - Updated dependencies [290bf7fb5]
50
+ - Updated dependencies [d88ffa666]
51
+ - Updated dependencies [0269ff40d]
52
+ - @rspack/dev-middleware@0.0.22
53
+ - @rspack/dev-client@0.0.22
54
+ - @rspack/dev-server@0.0.22
55
+
56
+ ## 0.0.21
57
+
58
+ ### Patch Changes
59
+
60
+ - fix watch
61
+ - Updated dependencies
62
+ - @rspack/core@0.0.21
63
+ - @rspack/dev-client@0.0.21
64
+ - @rspack/dev-middleware@0.0.21
65
+ - @rspack/dev-server@0.0.21
66
+
67
+ ## 0.0.20
68
+
69
+ ### Patch Changes
70
+
71
+ - fix load extra css chunk
72
+ - Updated dependencies
73
+ - @rspack/core@0.0.20
74
+ - @rspack/dev-client@0.0.20
75
+ - @rspack/dev-middleware@0.0.20
76
+ - @rspack/dev-server@0.0.20
77
+
78
+ ## 0.0.19
79
+
80
+ ### Patch Changes
81
+
82
+ - 882093b8: support module.resolve
83
+ - Updated dependencies [db66ae2e]
84
+ - Updated dependencies [882093b8]
85
+ - @rspack/core@0.0.19
86
+ - @rspack/dev-client@0.0.19
87
+ - @rspack/dev-middleware@0.0.19
88
+ - @rspack/dev-server@0.0.19
89
+
90
+ ## 0.0.18
91
+
92
+ ### Patch Changes
93
+
94
+ - bump version
95
+ - Updated dependencies
96
+ - @rspack/core@0.0.18
97
+ - @rspack/dev-client@0.0.18
98
+ - @rspack/dev-middleware@0.0.18
99
+ - @rspack/dev-server@0.0.18
100
+
101
+ ## 0.0.17
102
+
103
+ ### Patch Changes
104
+
105
+ - upgrade
106
+ - Updated dependencies
107
+ - @rspack/core@0.0.17
108
+ - @rspack/dev-client@0.0.17
109
+ - @rspack/dev-middleware@0.0.17
110
+ - @rspack/dev-server@0.0.17
111
+
112
+ ## 0.0.16
113
+
114
+ ### Patch Changes
115
+
116
+ - support optional dependency
117
+ - Updated dependencies
118
+ - @rspack/core@0.0.16
119
+ - @rspack/dev-client@0.0.16
120
+ - @rspack/dev-middleware@0.0.16
121
+ - @rspack/dev-server@0.0.16
122
+
123
+ ## 0.0.15
124
+
125
+ ### Patch Changes
126
+
127
+ - bump version
128
+ - Updated dependencies
129
+ - @rspack/core@0.0.15
130
+ - @rspack/dev-client@0.0.15
131
+ - @rspack/dev-middleware@0.0.15
132
+ - @rspack/dev-server@0.0.15
133
+
134
+ ## 0.0.14
135
+
136
+ ### Patch Changes
137
+
138
+ - bump version
139
+ - 11e87c61: fix less resolve bug
140
+ - Updated dependencies
141
+ - Updated dependencies [11e87c61]
142
+ - @rspack/core@0.0.14
143
+ - @rspack/dev-client@0.0.14
144
+ - @rspack/dev-middleware@0.0.14
145
+ - @rspack/dev-server@0.0.14
146
+
147
+ ## 0.0.13
148
+
149
+ ### Patch Changes
150
+
151
+ - 3701a8bf: fix less resolve bug
152
+ - Updated dependencies [3701a8bf]
153
+ - @rspack/core@0.0.13
154
+ - @rspack/dev-client@0.0.13
155
+ - @rspack/dev-middleware@0.0.13
156
+ - @rspack/dev-server@0.0.13
157
+
158
+ ## 0.0.12
159
+
160
+ ### Patch Changes
161
+
162
+ - @rspack/core@0.0.12
163
+ - @rspack/dev-client@0.0.12
164
+ - @rspack/dev-middleware@0.0.12
165
+ - @rspack/dev-server@0.0.12
166
+
167
+ ## 0.0.11
168
+
169
+ ### Patch Changes
170
+
171
+ - Updated dependencies [2eca9ade]
172
+ - @rspack/core@0.0.11
173
+ - @rspack/dev-middleware@0.0.11
174
+ - @rspack/dev-server@0.0.11
175
+ - @rspack/dev-client@0.0.11
176
+
177
+ ## 0.0.10
178
+
179
+ ### Patch Changes
180
+
181
+ - Updated dependencies [062e692d]
182
+ - @rspack/core@0.0.10
183
+ - @rspack/dev-middleware@0.0.10
184
+ - @rspack/dev-server@0.0.10
185
+ - @rspack/dev-client@0.0.10
186
+
187
+ ## 0.0.9
188
+
189
+ ### Patch Changes
190
+
191
+ - @rspack/core@0.0.9
192
+ - @rspack/dev-middleware@0.0.9
193
+ - @rspack/dev-server@0.0.9
194
+ - @rspack/dev-client@0.0.9
195
+
196
+ ## 0.0.8
197
+
198
+ ### Patch Changes
199
+
200
+ - 589b99bb: bump to 0.0.8
201
+ - Updated dependencies [589b99bb]
202
+ - @rspack/core@0.0.8
203
+ - @rspack/dev-client@0.0.8
204
+ - @rspack/dev-middleware@0.0.8
205
+ - @rspack/dev-server@0.0.8
206
+
207
+ ## 0.0.6
208
+
209
+ ### Patch Changes
210
+
211
+ - e6d0926a: unify version
212
+ - Updated dependencies [e6d0926a]
213
+ - @rspack/core@0.0.6
214
+ - @rspack/dev-server@0.0.6
215
+ - @rspack/dev-middleware@0.0.6
216
+ - @rspack/dev-client@0.0.6
217
+
218
+ ## 0.0.4
219
+
220
+ ### Patch Changes
221
+
222
+ - d466288: add process_assets hook
223
+
224
+ ## 0.0.3
225
+
226
+ ### Patch Changes
227
+
228
+ - 536f6f70: fix broken lib
229
+
230
+ ## 0.0.2
231
+
232
+ ### Patch Changes
233
+
234
+ - bd57e818: first release
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022-present Bytedance, Inc. and its affiliates.
4
+
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,16 @@
1
+ <picture>
2
+ <source media="(prefers-color-scheme: dark)" srcset="https://lf3-static.bytednsdoc.com/obj/eden-cn/rjhwzy/ljhwZthlaukjlkulzlp/rspack-banner-1610-dark.png">
3
+ <img alt="Rspack Banner" src="https://lf3-static.bytednsdoc.com/obj/eden-cn/rjhwzy/ljhwZthlaukjlkulzlp/rspack-banner-1610.png">
4
+ </picture>
5
+
6
+ # @rspack/dev-server
7
+
8
+ Development server for rspack.
9
+
10
+ ## Documentation
11
+
12
+ See [https://rspack.org](https://rspack.org) for details.
13
+
14
+ ## License
15
+
16
+ Rspack is [MIT licensed](https://github.com/modern-js-dev/rspack/blob/main/LICENSE).
@@ -0,0 +1,25 @@
1
+ import WebpackDevServer from "webpack-dev-server";
2
+ import type { DevServer } from "@rspack/core";
3
+ export type { DevServer };
4
+ export interface ResolvedDevServer extends DevServer {
5
+ port: number | string;
6
+ static: false | Array<WebpackDevServer.NormalizedStatic>;
7
+ devMiddleware: DevServer["devMiddleware"];
8
+ hot: boolean;
9
+ host?: string;
10
+ open: WebpackDevServer.Open[];
11
+ magicHtml: boolean;
12
+ liveReload: boolean;
13
+ webSocketServer: false | WebpackDevServer.WebSocketServerConfiguration;
14
+ proxy: WebpackDevServer.ProxyConfigArray;
15
+ client: WebpackDevServer.ClientConfiguration;
16
+ allowedHosts: "auto" | string[] | "all";
17
+ bonjour: false | Record<string, never> | WebpackDevServer.BonjourOptions;
18
+ compress: boolean;
19
+ historyApiFallback: false | WebpackDevServer.ConnectHistoryApiFallbackOptions;
20
+ server: WebpackDevServer.ServerConfiguration;
21
+ ipc: string | undefined;
22
+ setupExitSignals: boolean;
23
+ watchFiles: WebpackDevServer.WatchFiles[];
24
+ }
25
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B,MAAM,WAAW,iBAAkB,SAAQ,SAAS;IACnD,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACzD,aAAa,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC;IAE1C,GAAG,EAAE,OAAO,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,gBAAgB,CAAC,IAAI,EAAE,CAAC;IAC9B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,KAAK,GAAG,gBAAgB,CAAC,4BAA4B,CAAC;IACvE,KAAK,EAAE,gBAAgB,CAAC,gBAAgB,CAAC;IACzC,MAAM,EAAE,gBAAgB,CAAC,mBAAmB,CAAC;IAC7C,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,KAAK,CAAC;IACxC,OAAO,EAAE,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,gBAAgB,CAAC,cAAc,CAAC;IACzE,QAAQ,EAAE,OAAO,CAAC;IAClB,kBAAkB,EAAE,KAAK,GAAG,gBAAgB,CAAC,gCAAgC,CAAC;IAC9E,MAAM,EAAE,gBAAgB,CAAC,mBAAmB,CAAC;IAC7C,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,gBAAgB,CAAC,UAAU,EAAE,CAAC;CAC1C"}
package/dist/config.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export { RspackDevServer } from "./server";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RspackDevServer = void 0;
4
+ var server_1 = require("./server");
5
+ Object.defineProperty(exports, "RspackDevServer", { enumerable: true, get: function () { return server_1.RspackDevServer; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAA2C;AAAlC,yGAAA,eAAe,OAAA"}
@@ -0,0 +1,9 @@
1
+ import type { RspackOptionsNormalized } from "@rspack/core";
2
+ interface Status {
3
+ isUnloading: boolean;
4
+ currentHash: string;
5
+ previousHash: string[];
6
+ }
7
+ export declare function reloadApp({ liveReload, hot }: RspackOptionsNormalized["devServer"], status: Status): void;
8
+ export {};
9
+ //# sourceMappingURL=reload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reload.d.ts","sourceRoot":"","sources":["../src/reload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAE5D,UAAU,MAAM;IACf,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,wBAAgB,SAAS,CACxB,EAAE,UAAU,EAAE,GAAG,EAAE,EAAE,uBAAuB,CAAC,WAAW,CAAC,EACzD,MAAM,EAAE,MAAM,QAoBd"}
package/dist/reload.js ADDED
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.reloadApp = void 0;
4
+ function reloadApp({ liveReload, hot }, status) {
5
+ if (status.isUnloading) {
6
+ return;
7
+ }
8
+ function applyReload(rootWindow, intervalId) {
9
+ clearInterval(intervalId);
10
+ console.log("App update, Reloading...");
11
+ rootWindow.location.reload();
12
+ }
13
+ if (liveReload) {
14
+ let rootWindow = self;
15
+ const intervalId = self.setInterval(() => {
16
+ if (rootWindow.location.protocol !== "about:") {
17
+ applyReload(rootWindow, intervalId);
18
+ }
19
+ });
20
+ }
21
+ }
22
+ exports.reloadApp = reloadApp;
23
+ //# sourceMappingURL=reload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reload.js","sourceRoot":"","sources":["../src/reload.ts"],"names":[],"mappings":";;;AAQA,SAAgB,SAAS,CACxB,EAAE,UAAU,EAAE,GAAG,EAAwC,EACzD,MAAc;IAEd,IAAI,MAAM,CAAC,WAAW,EAAE;QACvB,OAAO;KACP;IAED,SAAS,WAAW,CAAC,UAAkB,EAAE,UAAkB;QAC1D,aAAa,CAAC,UAAU,CAAC,CAAC;QAC1B,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;QACxC,UAAU,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;IAC9B,CAAC;IAED,IAAI,UAAU,EAAE;QACf,IAAI,UAAU,GAAG,IAAI,CAAC;QACtB,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE;YACxC,IAAI,UAAU,CAAC,QAAQ,CAAC,QAAQ,KAAK,QAAQ,EAAE;gBAC9C,WAAW,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;aACpC;QACF,CAAC,CAAC,CAAC;KACH;AACF,CAAC;AAtBD,8BAsBC"}
@@ -0,0 +1,28 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { Compiler, MultiCompiler } from "@rspack/core";
4
+ import type { Socket } from "net";
5
+ import type { FSWatcher, WatchOptions } from "chokidar";
6
+ import type { Server } from "http";
7
+ import WebpackDevServer from "webpack-dev-server";
8
+ import type { ResolvedDevServer, DevServer } from "./config";
9
+ export declare class RspackDevServer extends WebpackDevServer {
10
+ /**
11
+ * resolved after `normalizedOptions`
12
+ */
13
+ options: ResolvedDevServer;
14
+ staticWatchers: FSWatcher[];
15
+ sockets: Socket[];
16
+ server: Server;
17
+ compiler: Compiler | MultiCompiler;
18
+ webSocketServer: WebpackDevServer.WebSocketServerImplementation | undefined;
19
+ constructor(options: DevServer, compiler: Compiler | MultiCompiler);
20
+ addAdditionEntires(compiler: Compiler): void;
21
+ watchFiles(watchPath: string | string[], watchOptions?: WatchOptions): void;
22
+ getClientTransport(): string;
23
+ initialize(): Promise<void>;
24
+ private setupDevMiddleware;
25
+ private setupMiddlewares;
26
+ private setupHooks;
27
+ }
28
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE7D,qBAAa,eAAgB,SAAQ,gBAAgB;IACpD;;OAEG;IACH,OAAO,EAAE,iBAAiB,CAAC;IAC3B,cAAc,EAAE,SAAS,EAAE,CAAC;IAC5B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IAER,QAAQ,EAAE,QAAQ,GAAG,aAAa,CAAC;IAC1C,eAAe,EAAE,gBAAgB,CAAC,6BAA6B,GAAG,SAAS,CAAC;gBAEhE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,GAAG,aAAa;IAKlE,kBAAkB,CAAC,QAAQ,EAAE,QAAQ;IA6KrC,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI;IAyB3E,kBAAkB,IAAI,MAAM;IAmEtB,UAAU;IAmFhB,OAAO,CAAC,kBAAkB;IAK1B,OAAO,CAAC,gBAAgB;IA2DxB,OAAO,CAAC,UAAU;CAQlB"}