@rsbuild/core 0.6.15 → 0.7.0-beta.1

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 (97) hide show
  1. package/bin/rsbuild.js +1 -1
  2. package/compiled/css-loader/api.js +85 -0
  3. package/compiled/css-loader/getUrl.js +26 -0
  4. package/compiled/css-loader/index.d.ts +1 -0
  5. package/compiled/css-loader/index.js +7363 -0
  6. package/compiled/css-loader/license +20 -0
  7. package/compiled/css-loader/noSourceMaps.js +5 -0
  8. package/compiled/css-loader/package.json +1 -0
  9. package/compiled/css-loader/sourceMaps.js +16 -0
  10. package/compiled/less-loader/index.d.ts +1 -0
  11. package/compiled/less-loader/index.js +414 -0
  12. package/compiled/less-loader/license +20 -0
  13. package/compiled/less-loader/package.json +1 -0
  14. package/compiled/postcss-load-config/292.index.js +2533 -0
  15. package/compiled/postcss-load-config/344.index.js +21 -0
  16. package/compiled/postcss-load-config/index.d.ts +1 -0
  17. package/compiled/postcss-load-config/index.js +1201 -0
  18. package/compiled/postcss-load-config/license +20 -0
  19. package/compiled/postcss-load-config/package.json +1 -0
  20. package/compiled/postcss-loader/index.d.ts +1 -0
  21. package/compiled/postcss-loader/index.js +9278 -0
  22. package/compiled/postcss-loader/license +20 -0
  23. package/compiled/postcss-loader/package.json +1 -0
  24. package/compiled/postcss-value-parser/index.d.ts +1 -0
  25. package/compiled/postcss-value-parser/index.js +624 -0
  26. package/compiled/postcss-value-parser/license +22 -0
  27. package/compiled/postcss-value-parser/package.json +1 -0
  28. package/compiled/resolve-url-loader/index.d.ts +1 -0
  29. package/compiled/resolve-url-loader/index.js +5719 -0
  30. package/compiled/resolve-url-loader/license +21 -0
  31. package/compiled/resolve-url-loader/package.json +1 -0
  32. package/compiled/style-loader/index.d.ts +1 -0
  33. package/compiled/style-loader/index.js +513 -0
  34. package/compiled/style-loader/license +20 -0
  35. package/compiled/style-loader/package.json +1 -0
  36. package/compiled/style-loader/runtime/injectStylesIntoLinkTag.js +29 -0
  37. package/compiled/style-loader/runtime/injectStylesIntoStyleTag.js +84 -0
  38. package/compiled/style-loader/runtime/insertBySelector.js +34 -0
  39. package/compiled/style-loader/runtime/insertStyleElement.js +10 -0
  40. package/compiled/style-loader/runtime/isEqualLocals.js +28 -0
  41. package/compiled/style-loader/runtime/isOldIE.js +17 -0
  42. package/compiled/style-loader/runtime/setAttributesWithAttributes.js +13 -0
  43. package/compiled/style-loader/runtime/setAttributesWithAttributesAndNonce.js +9 -0
  44. package/compiled/style-loader/runtime/setAttributesWithoutAttributes.js +10 -0
  45. package/compiled/style-loader/runtime/singletonStyleDomAPI.js +86 -0
  46. package/compiled/style-loader/runtime/styleDomAPI.js +61 -0
  47. package/compiled/style-loader/runtime/styleTagTransform.js +14 -0
  48. package/dist/cli/commands.js +2 -2
  49. package/dist/cli/prepare.js +2 -2
  50. package/dist/config.js +0 -1
  51. package/dist/createContext.js +1 -1
  52. package/dist/index.js +1 -1
  53. package/dist/internal.d.ts +2 -2
  54. package/dist/internal.js +8 -8
  55. package/dist/loadEnv.js +2 -2
  56. package/dist/{htmlUtils.d.ts → pluginHelper.d.ts} +4 -1
  57. package/dist/pluginHelper.js +66 -0
  58. package/dist/plugins/css.d.ts +19 -0
  59. package/dist/plugins/css.js +257 -0
  60. package/dist/plugins/index.d.ts +4 -0
  61. package/dist/plugins/index.js +4 -0
  62. package/dist/{provider/plugins → plugins}/less.d.ts +1 -1
  63. package/dist/{provider/plugins → plugins}/less.js +45 -10
  64. package/dist/plugins/manifest.js +1 -1
  65. package/dist/{provider/plugins → plugins}/output.d.ts +1 -1
  66. package/dist/{provider/plugins → plugins}/output.js +21 -14
  67. package/dist/plugins/performance.js +5 -11
  68. package/dist/plugins/resourceHints.js +17 -22
  69. package/dist/plugins/sass.d.ts +18 -0
  70. package/dist/{provider/plugins → plugins}/sass.js +83 -12
  71. package/dist/plugins/startUrl.js +1 -1
  72. package/dist/provider/plugins/swc.d.ts +0 -2
  73. package/dist/provider/plugins/swc.js +1 -3
  74. package/dist/provider/provider.js +4 -4
  75. package/dist/provider/rspackConfig.js +2 -2
  76. package/dist/rspack/HtmlAppIconPlugin.js +2 -2
  77. package/dist/rspack/HtmlBasicPlugin.js +2 -2
  78. package/dist/rspack/InlineChunkHtmlPlugin.js +2 -2
  79. package/dist/rspack/ignoreCssLoader.d.ts +2 -0
  80. package/dist/{htmlUtils.js → rspack/ignoreCssLoader.js} +10 -21
  81. package/dist/rspack/preload/HtmlPreloadOrPrefetchPlugin.js +3 -3
  82. package/dist/server/devMiddleware.js +1 -1
  83. package/dist/server/getDevMiddlewares.js +4 -4
  84. package/dist/server/middlewares.js +1 -1
  85. package/dist/server/prodServer.js +3 -3
  86. package/dist/server/socketServer.d.ts +1 -1
  87. package/dist/server/socketServer.js +1 -1
  88. package/package.json +12 -3
  89. package/dist/provider/css-modules-typescript-pre-loader/index.d.ts +0 -6
  90. package/dist/provider/css-modules-typescript-pre-loader/index.js +0 -84
  91. package/dist/provider/css-modules-typescript-pre-loader/postcssIcssExtractPlugin.d.ts +0 -11
  92. package/dist/provider/css-modules-typescript-pre-loader/postcssIcssExtractPlugin.js +0 -66
  93. package/dist/provider/plugins/css.d.ts +0 -17
  94. package/dist/provider/plugins/css.js +0 -202
  95. package/dist/provider/plugins/sass.d.ts +0 -2
  96. package/dist/rspack/RemoveCssSourcemapPlugin.d.ts +0 -6
  97. package/dist/rspack/RemoveCssSourcemapPlugin.js +0 -55
package/bin/rsbuild.js CHANGED
@@ -8,7 +8,7 @@ async function main() {
8
8
  const { runCli } = require('../dist/cli/commands');
9
9
  runCli();
10
10
  } catch (err) {
11
- const { logger } = require('@rsbuild/shared/rslog');
11
+ const { logger } = require('@rsbuild/shared');
12
12
  logger.error(err);
13
13
  }
14
14
  }
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+
3
+ /*
4
+ MIT License http://www.opensource.org/licenses/mit-license.php
5
+ Author Tobias Koppers @sokra
6
+ */
7
+ module.exports = function (cssWithMappingToString) {
8
+ var list = [];
9
+
10
+ // return the list of modules as css string
11
+ list.toString = function toString() {
12
+ return this.map(function (item) {
13
+ var content = "";
14
+ var needLayer = typeof item[5] !== "undefined";
15
+ if (item[4]) {
16
+ content += "@supports (".concat(item[4], ") {");
17
+ }
18
+ if (item[2]) {
19
+ content += "@media ".concat(item[2], " {");
20
+ }
21
+ if (needLayer) {
22
+ content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
23
+ }
24
+ content += cssWithMappingToString(item);
25
+ if (needLayer) {
26
+ content += "}";
27
+ }
28
+ if (item[2]) {
29
+ content += "}";
30
+ }
31
+ if (item[4]) {
32
+ content += "}";
33
+ }
34
+ return content;
35
+ }).join("");
36
+ };
37
+
38
+ // import a list of modules into the list
39
+ list.i = function i(modules, media, dedupe, supports, layer) {
40
+ if (typeof modules === "string") {
41
+ modules = [[null, modules, undefined]];
42
+ }
43
+ var alreadyImportedModules = {};
44
+ if (dedupe) {
45
+ for (var k = 0; k < this.length; k++) {
46
+ var id = this[k][0];
47
+ if (id != null) {
48
+ alreadyImportedModules[id] = true;
49
+ }
50
+ }
51
+ }
52
+ for (var _k = 0; _k < modules.length; _k++) {
53
+ var item = [].concat(modules[_k]);
54
+ if (dedupe && alreadyImportedModules[item[0]]) {
55
+ continue;
56
+ }
57
+ if (typeof layer !== "undefined") {
58
+ if (typeof item[5] === "undefined") {
59
+ item[5] = layer;
60
+ } else {
61
+ item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
62
+ item[5] = layer;
63
+ }
64
+ }
65
+ if (media) {
66
+ if (!item[2]) {
67
+ item[2] = media;
68
+ } else {
69
+ item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
70
+ item[2] = media;
71
+ }
72
+ }
73
+ if (supports) {
74
+ if (!item[4]) {
75
+ item[4] = "".concat(supports);
76
+ } else {
77
+ item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
78
+ item[4] = supports;
79
+ }
80
+ }
81
+ list.push(item);
82
+ }
83
+ };
84
+ return list;
85
+ };
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ module.exports = function (url, options) {
4
+ if (!options) {
5
+ options = {};
6
+ }
7
+ if (!url) {
8
+ return url;
9
+ }
10
+ url = String(url.__esModule ? url.default : url);
11
+
12
+ // If url is already wrapped in quotes, remove them
13
+ if (/^['"].*['"]$/.test(url)) {
14
+ url = url.slice(1, -1);
15
+ }
16
+ if (options.hash) {
17
+ url += options.hash;
18
+ }
19
+
20
+ // Should url be wrapped?
21
+ // See https://drafts.csswg.org/css-values-3/#urls
22
+ if (/["'() \t\n]|(%20)/.test(url) || options.needQuotes) {
23
+ return "\"".concat(url.replace(/"/g, '\\"').replace(/\n/g, "\\n"), "\"");
24
+ }
25
+ return url;
26
+ };
@@ -0,0 +1 @@
1
+ export = any;