@rsbuild/core 1.0.13 → 1.0.15
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/compiled/css-loader/index.js +20 -20
- package/compiled/html-rspack-plugin/index.js +14 -14
- package/compiled/postcss-loader/index.js +8 -8
- package/compiled/rspack-chain/index.d.ts +8 -3
- package/compiled/rspack-manifest-plugin/index.js +4 -4
- package/compiled/sirv/index.js +14 -6
- package/compiled/sirv/package.json +1 -1
- package/dist/index.cjs +60 -37
- package/dist/index.js +63 -40
- package/dist-types/constants.d.ts +1 -0
- package/dist-types/loadEnv.d.ts +26 -3
- package/dist-types/types/config.d.ts +10 -0
- package/package.json +3 -3
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
|
|
3
|
+
2358: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
4
4
|
"use strict";
|
|
5
|
-
const loader = __nccwpck_require__(
|
|
5
|
+
const loader = __nccwpck_require__(536);
|
|
6
6
|
module.exports = loader.default;
|
|
7
7
|
module.exports.defaultGetLocalIdent =
|
|
8
|
-
__nccwpck_require__(
|
|
8
|
+
__nccwpck_require__(9166).defaultGetLocalIdent;
|
|
9
9
|
},
|
|
10
|
-
|
|
10
|
+
536: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
11
11
|
"use strict";
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports["default"] = loader;
|
|
14
14
|
var _postcss = _interopRequireDefault(__nccwpck_require__(9961));
|
|
15
15
|
var _package = _interopRequireDefault(__nccwpck_require__(3360));
|
|
16
16
|
var _semver = { satisfies: () => true };
|
|
17
|
-
var _options = _interopRequireDefault(__nccwpck_require__(
|
|
18
|
-
var _plugins = __nccwpck_require__(
|
|
19
|
-
var _utils = __nccwpck_require__(
|
|
17
|
+
var _options = _interopRequireDefault(__nccwpck_require__(2438));
|
|
18
|
+
var _plugins = __nccwpck_require__(9490);
|
|
19
|
+
var _utils = __nccwpck_require__(9166);
|
|
20
20
|
function _interopRequireDefault(obj) {
|
|
21
21
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
22
22
|
}
|
|
@@ -243,7 +243,7 @@
|
|
|
243
243
|
callback(null, `${importCode}${moduleCode}${exportCode}`);
|
|
244
244
|
}
|
|
245
245
|
},
|
|
246
|
-
|
|
246
|
+
9490: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
247
247
|
"use strict";
|
|
248
248
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
249
249
|
Object.defineProperty(exports, "icssParser", {
|
|
@@ -265,22 +265,22 @@
|
|
|
265
265
|
},
|
|
266
266
|
});
|
|
267
267
|
var _postcssImportParser = _interopRequireDefault(
|
|
268
|
-
__nccwpck_require__(
|
|
268
|
+
__nccwpck_require__(2782),
|
|
269
269
|
);
|
|
270
270
|
var _postcssIcssParser = _interopRequireDefault(
|
|
271
|
-
__nccwpck_require__(
|
|
271
|
+
__nccwpck_require__(1885),
|
|
272
272
|
);
|
|
273
|
-
var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(
|
|
273
|
+
var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(4908));
|
|
274
274
|
function _interopRequireDefault(obj) {
|
|
275
275
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
276
276
|
}
|
|
277
277
|
},
|
|
278
|
-
|
|
278
|
+
1885: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
279
279
|
"use strict";
|
|
280
280
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
281
281
|
exports["default"] = void 0;
|
|
282
282
|
var _icssUtils = __nccwpck_require__(8406);
|
|
283
|
-
var _utils = __nccwpck_require__(
|
|
283
|
+
var _utils = __nccwpck_require__(9166);
|
|
284
284
|
const plugin = (options = {}) => ({
|
|
285
285
|
postcssPlugin: "postcss-icss-parser",
|
|
286
286
|
async OnceExit(root) {
|
|
@@ -379,14 +379,14 @@
|
|
|
379
379
|
plugin.postcss = true;
|
|
380
380
|
var _default = (exports["default"] = plugin);
|
|
381
381
|
},
|
|
382
|
-
|
|
382
|
+
2782: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
383
383
|
"use strict";
|
|
384
384
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
385
385
|
exports["default"] = void 0;
|
|
386
386
|
var _postcssValueParser = _interopRequireDefault(
|
|
387
387
|
__nccwpck_require__(7555),
|
|
388
388
|
);
|
|
389
|
-
var _utils = __nccwpck_require__(
|
|
389
|
+
var _utils = __nccwpck_require__(9166);
|
|
390
390
|
function _interopRequireDefault(obj) {
|
|
391
391
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
392
392
|
}
|
|
@@ -691,14 +691,14 @@
|
|
|
691
691
|
plugin.postcss = true;
|
|
692
692
|
var _default = (exports["default"] = plugin);
|
|
693
693
|
},
|
|
694
|
-
|
|
694
|
+
4908: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
695
695
|
"use strict";
|
|
696
696
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
697
697
|
exports["default"] = void 0;
|
|
698
698
|
var _postcssValueParser = _interopRequireDefault(
|
|
699
699
|
__nccwpck_require__(7555),
|
|
700
700
|
);
|
|
701
|
-
var _utils = __nccwpck_require__(
|
|
701
|
+
var _utils = __nccwpck_require__(9166);
|
|
702
702
|
function _interopRequireDefault(obj) {
|
|
703
703
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
704
704
|
}
|
|
@@ -1041,7 +1041,7 @@
|
|
|
1041
1041
|
plugin.postcss = true;
|
|
1042
1042
|
var _default = (exports["default"] = plugin);
|
|
1043
1043
|
},
|
|
1044
|
-
|
|
1044
|
+
9166: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
1045
1045
|
"use strict";
|
|
1046
1046
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1047
1047
|
exports.WEBPACK_IGNORE_COMMENT_REGEXP = void 0;
|
|
@@ -7960,7 +7960,7 @@
|
|
|
7960
7960
|
"use strict";
|
|
7961
7961
|
module.exports = require("util");
|
|
7962
7962
|
},
|
|
7963
|
-
|
|
7963
|
+
2438: (module) => {
|
|
7964
7964
|
"use strict";
|
|
7965
7965
|
module.exports = JSON.parse(
|
|
7966
7966
|
'{"title":"CSS Loader options","additionalProperties":false,"properties":{"url":{"description":"Allows to enables/disables `url()`/`image-set()` functions handling.","link":"https://github.com/webpack-contrib/css-loader#url","anyOf":[{"type":"boolean"},{"type":"object","properties":{"filter":{"instanceof":"Function"}},"additionalProperties":false}]},"import":{"description":"Allows to enables/disables `@import` at-rules handling.","link":"https://github.com/webpack-contrib/css-loader#import","anyOf":[{"type":"boolean"},{"type":"object","properties":{"filter":{"instanceof":"Function"}},"additionalProperties":false}]},"modules":{"description":"Allows to enable/disable CSS Modules or ICSS and setup configuration.","link":"https://github.com/webpack-contrib/css-loader#modules","anyOf":[{"type":"boolean"},{"enum":["local","global","pure","icss"]},{"type":"object","additionalProperties":false,"properties":{"auto":{"description":"Allows auto enable CSS modules based on filename.","link":"https://github.com/webpack-contrib/css-loader#auto","anyOf":[{"instanceof":"RegExp"},{"instanceof":"Function"},{"type":"boolean"}]},"mode":{"description":"Setup `mode` option.","link":"https://github.com/webpack-contrib/css-loader#mode","anyOf":[{"enum":["local","global","pure","icss"]},{"instanceof":"Function"}]},"localIdentName":{"description":"Allows to configure the generated local ident name.","link":"https://github.com/webpack-contrib/css-loader#localidentname","type":"string","minLength":1},"localIdentContext":{"description":"Allows to redefine basic loader context for local ident name.","link":"https://github.com/webpack-contrib/css-loader#localidentcontext","type":"string","minLength":1},"localIdentHashSalt":{"description":"Allows to add custom hash to generate more unique classes.","link":"https://github.com/webpack-contrib/css-loader#localidenthashsalt","type":"string","minLength":1},"localIdentHashFunction":{"description":"Allows to specify hash function to generate classes.","link":"https://github.com/webpack-contrib/css-loader#localidenthashfunction","type":"string","minLength":1},"localIdentHashDigest":{"description":"Allows to specify hash digest to generate classes.","link":"https://github.com/webpack-contrib/css-loader#localidenthashdigest","type":"string","minLength":1},"localIdentHashDigestLength":{"description":"Allows to specify hash digest length to generate classes.","link":"https://github.com/webpack-contrib/css-loader#localidenthashdigestlength","type":"number"},"hashStrategy":{"description":"Allows to specify should localName be used when computing the hash.","link":"https://github.com/webpack-contrib/css-loader#hashstrategy","enum":["resource-path-and-local-name","minimal-subset"]},"localIdentRegExp":{"description":"Allows to specify custom RegExp for local ident name.","link":"https://github.com/webpack-contrib/css-loader#localidentregexp","anyOf":[{"type":"string","minLength":1},{"instanceof":"RegExp"}]},"getLocalIdent":{"description":"Allows to specify a function to generate the classname.","link":"https://github.com/webpack-contrib/css-loader#getlocalident","instanceof":"Function"},"namedExport":{"description":"Enables/disables ES modules named export for locals.","link":"https://github.com/webpack-contrib/css-loader#namedexport","type":"boolean"},"exportGlobals":{"description":"Allows to export names from global class or id, so you can use that as local name.","link":"https://github.com/webpack-contrib/css-loader#exportglobals","type":"boolean"},"exportLocalsConvention":{"description":"Style of exported classnames.","link":"https://github.com/webpack-contrib/css-loader#localsconvention","anyOf":[{"enum":["asIs","as-is","camelCase","camel-case","camelCaseOnly","camel-case-only","dashes","dashesOnly","dashes-only"]},{"instanceof":"Function"}]},"exportOnlyLocals":{"description":"Export only locals.","link":"https://github.com/webpack-contrib/css-loader#exportonlylocals","type":"boolean"},"getJSON":{"description":"Allows outputting of CSS modules mapping through a callback.","link":"https://github.com/webpack-contrib/css-loader#getJSON","instanceof":"Function"}}}]},"sourceMap":{"description":"Allows to enable/disable source maps.","link":"https://github.com/webpack-contrib/css-loader#sourcemap","type":"boolean"},"importLoaders":{"description":"Allows enables/disables or setups number of loaders applied before CSS loader for `@import`/CSS Modules and ICSS imports.","link":"https://github.com/webpack-contrib/css-loader#importloaders","anyOf":[{"type":"boolean"},{"type":"string"},{"type":"integer"}]},"esModule":{"description":"Use the ES modules syntax.","link":"https://github.com/webpack-contrib/css-loader#esmodule","type":"boolean"},"exportType":{"description":"Allows exporting styles as array with modules, string or constructable stylesheet (i.e. `CSSStyleSheet`).","link":"https://github.com/webpack-contrib/css-loader#exporttype","enum":["array","string","css-style-sheet"]}},"type":"object"}',
|
|
@@ -7995,6 +7995,6 @@
|
|
|
7995
7995
|
}
|
|
7996
7996
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
7997
7997
|
__nccwpck_require__.ab = __dirname + "/";
|
|
7998
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
7998
|
+
var __webpack_exports__ = __nccwpck_require__(2358);
|
|
7999
7999
|
module.exports = __webpack_exports__;
|
|
8000
8000
|
})();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
|
|
3
|
+
241: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
4
4
|
"use strict";
|
|
5
|
-
const { HtmlWebpackChildCompiler } = __nccwpck_require__(
|
|
5
|
+
const { HtmlWebpackChildCompiler } = __nccwpck_require__(361);
|
|
6
6
|
const compilerMap = new WeakMap();
|
|
7
7
|
class CachedChildCompilation {
|
|
8
8
|
constructor(compiler) {
|
|
@@ -304,7 +304,7 @@
|
|
|
304
304
|
}
|
|
305
305
|
module.exports = { CachedChildCompilation };
|
|
306
306
|
},
|
|
307
|
-
|
|
307
|
+
361: (module) => {
|
|
308
308
|
"use strict";
|
|
309
309
|
class HtmlWebpackChildCompiler {
|
|
310
310
|
constructor(templates) {
|
|
@@ -473,7 +473,7 @@
|
|
|
473
473
|
}
|
|
474
474
|
module.exports = { HtmlWebpackChildCompiler };
|
|
475
475
|
},
|
|
476
|
-
|
|
476
|
+
479: (module) => {
|
|
477
477
|
"use strict";
|
|
478
478
|
module.exports = {};
|
|
479
479
|
module.exports.none = (chunks) => chunks;
|
|
@@ -492,7 +492,7 @@
|
|
|
492
492
|
};
|
|
493
493
|
module.exports.auto = module.exports.none;
|
|
494
494
|
},
|
|
495
|
-
|
|
495
|
+
135: (module) => {
|
|
496
496
|
"use strict";
|
|
497
497
|
module.exports = function (err) {
|
|
498
498
|
return {
|
|
@@ -513,7 +513,7 @@
|
|
|
513
513
|
};
|
|
514
514
|
};
|
|
515
515
|
},
|
|
516
|
-
|
|
516
|
+
935: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
517
517
|
"use strict";
|
|
518
518
|
const { AsyncSeriesWaterfallHook } = __nccwpck_require__(348);
|
|
519
519
|
const htmlWebpackPluginHooksMap = new WeakMap();
|
|
@@ -539,7 +539,7 @@
|
|
|
539
539
|
}
|
|
540
540
|
module.exports = { getHtmlRspackPluginHooks };
|
|
541
541
|
},
|
|
542
|
-
|
|
542
|
+
697: (module) => {
|
|
543
543
|
const voidTags = [
|
|
544
544
|
"area",
|
|
545
545
|
"base",
|
|
@@ -607,19 +607,19 @@
|
|
|
607
607
|
htmlTagObjectToString,
|
|
608
608
|
};
|
|
609
609
|
},
|
|
610
|
-
|
|
610
|
+
922: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
611
611
|
"use strict";
|
|
612
612
|
const promisify = __nccwpck_require__(837).promisify;
|
|
613
613
|
const vm = __nccwpck_require__(144);
|
|
614
614
|
const fs = __nccwpck_require__(147);
|
|
615
615
|
const path = __nccwpck_require__(17);
|
|
616
|
-
const { CachedChildCompilation } = __nccwpck_require__(
|
|
616
|
+
const { CachedChildCompilation } = __nccwpck_require__(241);
|
|
617
617
|
const { createHtmlTagObject, htmlTagObjectToString, HtmlTagArray } =
|
|
618
|
-
__nccwpck_require__(
|
|
619
|
-
const prettyError = __nccwpck_require__(
|
|
620
|
-
const chunkSorter = __nccwpck_require__(
|
|
618
|
+
__nccwpck_require__(697);
|
|
619
|
+
const prettyError = __nccwpck_require__(135);
|
|
620
|
+
const chunkSorter = __nccwpck_require__(479);
|
|
621
621
|
const getHtmlRspackPluginHooks =
|
|
622
|
-
__nccwpck_require__(
|
|
622
|
+
__nccwpck_require__(935).getHtmlRspackPluginHooks;
|
|
623
623
|
class HtmlRspackPlugin {
|
|
624
624
|
constructor(userOptions = {}) {
|
|
625
625
|
this.version = HtmlRspackPlugin.version;
|
|
@@ -1577,6 +1577,6 @@
|
|
|
1577
1577
|
}
|
|
1578
1578
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
1579
1579
|
__nccwpck_require__.ab = __dirname + "/";
|
|
1580
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
1580
|
+
var __webpack_exports__ = __nccwpck_require__(922);
|
|
1581
1581
|
module.exports = __webpack_exports__;
|
|
1582
1582
|
})();
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
"use strict";
|
|
3
3
|
var __webpack_modules__ = {
|
|
4
|
-
|
|
5
|
-
module.exports = __nccwpck_require__(
|
|
4
|
+
533: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
5
|
+
module.exports = __nccwpck_require__(646)["default"];
|
|
6
6
|
},
|
|
7
|
-
|
|
7
|
+
646: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
8
8
|
var __webpack_unused_export__;
|
|
9
9
|
__webpack_unused_export__ = { value: true };
|
|
10
10
|
exports["default"] = loader;
|
|
11
11
|
var _path = _interopRequireDefault(__nccwpck_require__(17));
|
|
12
12
|
var _package = _interopRequireDefault(__nccwpck_require__(360));
|
|
13
|
-
var _options = _interopRequireDefault(__nccwpck_require__(
|
|
14
|
-
var _utils = __nccwpck_require__(
|
|
13
|
+
var _options = _interopRequireDefault(__nccwpck_require__(839));
|
|
14
|
+
var _utils = __nccwpck_require__(107);
|
|
15
15
|
function _interopRequireDefault(obj) {
|
|
16
16
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
17
17
|
}
|
|
@@ -189,7 +189,7 @@
|
|
|
189
189
|
callback(null, result.css, map, { ast });
|
|
190
190
|
}
|
|
191
191
|
},
|
|
192
|
-
|
|
192
|
+
107: (module, exports, __nccwpck_require__) => {
|
|
193
193
|
module = __nccwpck_require__.nmd(module);
|
|
194
194
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
195
195
|
exports.exec = exec;
|
|
@@ -691,7 +691,7 @@
|
|
|
691
691
|
310: (module) => {
|
|
692
692
|
module.exports = require("url");
|
|
693
693
|
},
|
|
694
|
-
|
|
694
|
+
839: (module) => {
|
|
695
695
|
module.exports = JSON.parse(
|
|
696
696
|
'{"title":"PostCSS Loader options","type":"object","properties":{"postcssOptions":{"description":"Options to pass through to `Postcss`.","link":"https://github.com/webpack-contrib/postcss-loader#postcssOptions","anyOf":[{"type":"object","additionalProperties":true,"properties":{"config":{"description":"Allows to specify PostCSS config path.","link":"https://github.com/webpack-contrib/postcss-loader#config","anyOf":[{"description":"Allows to specify the path to the configuration file","type":"string"},{"description":"Enables/Disables autoloading config","type":"boolean"}]}}},{"instanceof":"Function"}]},"execute":{"description":"Enables/Disables PostCSS parser support in \'CSS-in-JS\'.","link":"https://github.com/webpack-contrib/postcss-loader#execute","type":"boolean"},"sourceMap":{"description":"Enables/Disables generation of source maps.","link":"https://github.com/webpack-contrib/postcss-loader#sourcemap","type":"boolean"},"implementation":{"description":"The implementation of postcss to use, instead of the locally installed version","link":"https://github.com/webpack-contrib/postcss-loader#implementation","anyOf":[{"type":"string"},{"instanceof":"Function"}]}},"additionalProperties":false}',
|
|
697
697
|
);
|
|
@@ -736,6 +736,6 @@
|
|
|
736
736
|
})();
|
|
737
737
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
738
738
|
__nccwpck_require__.ab = __dirname + "/";
|
|
739
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
739
|
+
var __webpack_exports__ = __nccwpck_require__(533);
|
|
740
740
|
module.exports = __webpack_exports__;
|
|
741
741
|
})();
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Configuration,
|
|
3
|
+
Compiler,
|
|
4
|
+
RuleSetRule,
|
|
5
|
+
ResolveOptions,
|
|
6
|
+
} from '@rspack/core';
|
|
2
7
|
import * as https from 'https';
|
|
3
8
|
|
|
9
|
+
export = Config;
|
|
10
|
+
|
|
4
11
|
// The compiler type of Rspack / webpack are mismatch,
|
|
5
12
|
// so we use a loose type here to allow using webpack plugins.
|
|
6
13
|
interface PluginInstance {
|
|
@@ -599,5 +606,3 @@ declare namespace Config {
|
|
|
599
606
|
after(name: string): this;
|
|
600
607
|
}
|
|
601
608
|
}
|
|
602
|
-
|
|
603
|
-
export { Config as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
"use strict";
|
|
3
3
|
var __webpack_modules__ = {
|
|
4
|
-
|
|
4
|
+
376: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.transformFiles =
|
|
7
7
|
exports.reduceChunk =
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
.map(standardizeFilePaths);
|
|
121
121
|
exports.transformFiles = transformFiles;
|
|
122
122
|
},
|
|
123
|
-
|
|
123
|
+
317: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
124
124
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
125
125
|
exports.normalModuleLoaderHook =
|
|
126
126
|
exports.getCompilerHooks =
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
const fs_1 = __nccwpck_require__(147);
|
|
131
131
|
const path_1 = __nccwpck_require__(17);
|
|
132
132
|
const lite_tapable_1 = __nccwpck_require__(348);
|
|
133
|
-
const helpers_1 = __nccwpck_require__(
|
|
133
|
+
const helpers_1 = __nccwpck_require__(376);
|
|
134
134
|
const compilerHookMap = new WeakMap();
|
|
135
135
|
const getCompilerHooks = (compiler) => {
|
|
136
136
|
let hooks = compilerHookMap.get(compiler);
|
|
@@ -312,7 +312,7 @@
|
|
|
312
312
|
exports.getCompilerHooks =
|
|
313
313
|
void 0;
|
|
314
314
|
const path_1 = __nccwpck_require__(17);
|
|
315
|
-
const hooks_1 = __nccwpck_require__(
|
|
315
|
+
const hooks_1 = __nccwpck_require__(317);
|
|
316
316
|
Object.defineProperty(exports, "getCompilerHooks", {
|
|
317
317
|
enumerable: true,
|
|
318
318
|
get: function () {
|
package/compiled/sirv/index.js
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
}
|
|
25
25
|
exports.parse = parse;
|
|
26
26
|
},
|
|
27
|
-
|
|
27
|
+
486: (__unused_webpack_module, exports) => {
|
|
28
28
|
const mimes = {
|
|
29
29
|
"3g2": "video/3gpp2",
|
|
30
30
|
"3gp": "video/3gpp",
|
|
@@ -469,12 +469,12 @@
|
|
|
469
469
|
exports.mimes = mimes;
|
|
470
470
|
exports.lookup = lookup;
|
|
471
471
|
},
|
|
472
|
-
|
|
473
|
-
const fs = __nccwpck_require__(
|
|
474
|
-
const { join, normalize, resolve } = __nccwpck_require__(
|
|
472
|
+
761: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
473
|
+
const fs = __nccwpck_require__(561);
|
|
474
|
+
const { join, normalize, resolve } = __nccwpck_require__(411);
|
|
475
475
|
const { totalist } = __nccwpck_require__(190);
|
|
476
476
|
const { parse } = __nccwpck_require__(665);
|
|
477
|
-
const { lookup } = __nccwpck_require__(
|
|
477
|
+
const { lookup } = __nccwpck_require__(486);
|
|
478
478
|
const noop = () => {};
|
|
479
479
|
function isMatch(uri, arr) {
|
|
480
480
|
for (let i = 0; i < arr.length; i++) {
|
|
@@ -665,6 +665,14 @@
|
|
|
665
665
|
"use strict";
|
|
666
666
|
module.exports = require("fs");
|
|
667
667
|
},
|
|
668
|
+
561: (module) => {
|
|
669
|
+
"use strict";
|
|
670
|
+
module.exports = require("node:fs");
|
|
671
|
+
},
|
|
672
|
+
411: (module) => {
|
|
673
|
+
"use strict";
|
|
674
|
+
module.exports = require("node:path");
|
|
675
|
+
},
|
|
668
676
|
17: (module) => {
|
|
669
677
|
"use strict";
|
|
670
678
|
module.exports = require("path");
|
|
@@ -696,6 +704,6 @@
|
|
|
696
704
|
}
|
|
697
705
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
698
706
|
__nccwpck_require__.ab = __dirname + "/";
|
|
699
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
707
|
+
var __webpack_exports__ = __nccwpck_require__(761);
|
|
700
708
|
module.exports = __webpack_exports__;
|
|
701
709
|
})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"sirv","author":{"name":"Luke Edwards","email":"luke@lukeed.com","url":"https://lukeed.com"},"version":"
|
|
1
|
+
{"name":"sirv","author":{"name":"Luke Edwards","email":"luke@lukeed.com","url":"https://lukeed.com"},"version":"3.0.0","license":"MIT","types":"index.d.ts","type":"commonjs"}
|
package/dist/index.cjs
CHANGED
|
@@ -3138,7 +3138,7 @@ var init_logger = __esm({
|
|
|
3138
3138
|
});
|
|
3139
3139
|
|
|
3140
3140
|
// src/constants.ts
|
|
3141
|
-
var import_node_path, ROOT_DIST_DIR, HTML_DIST_DIR, JS_DIST_DIR, CSS_DIST_DIR, SVG_DIST_DIR, FONT_DIST_DIR, WASM_DIST_DIR, IMAGE_DIST_DIR, MEDIA_DIST_DIR, LOADER_PATH, STATIC_PATH, COMPILED_PATH, TS_CONFIG_FILE, HMR_SOCKET_PATH, RSBUILD_OUTPUTS_PATH, DEFAULT_PORT, DEFAULT_DATA_URL_SIZE, DEFAULT_MOUNT_ID, DEFAULT_DEV_HOST, DEFAULT_ASSET_PREFIX, DEFAULT_WEB_BROWSERSLIST, DEFAULT_BROWSERSLIST, HTML_REGEX, JS_REGEX, SCRIPT_REGEX, CSS_REGEX, NODE_MODULES_REGEX, PLUGIN_SWC_NAME, PLUGIN_CSS_NAME, FONT_EXTENSIONS, IMAGE_EXTENSIONS, VIDEO_EXTENSIONS, AUDIO_EXTENSIONS;
|
|
3141
|
+
var import_node_path, ROOT_DIST_DIR, HTML_DIST_DIR, JS_DIST_DIR, CSS_DIST_DIR, SVG_DIST_DIR, FONT_DIST_DIR, WASM_DIST_DIR, IMAGE_DIST_DIR, MEDIA_DIST_DIR, ASSETS_DIST_DIR, LOADER_PATH, STATIC_PATH, COMPILED_PATH, TS_CONFIG_FILE, HMR_SOCKET_PATH, RSBUILD_OUTPUTS_PATH, DEFAULT_PORT, DEFAULT_DATA_URL_SIZE, DEFAULT_MOUNT_ID, DEFAULT_DEV_HOST, DEFAULT_ASSET_PREFIX, DEFAULT_WEB_BROWSERSLIST, DEFAULT_BROWSERSLIST, HTML_REGEX, JS_REGEX, SCRIPT_REGEX, CSS_REGEX, NODE_MODULES_REGEX, PLUGIN_SWC_NAME, PLUGIN_CSS_NAME, FONT_EXTENSIONS, IMAGE_EXTENSIONS, VIDEO_EXTENSIONS, AUDIO_EXTENSIONS;
|
|
3142
3142
|
var init_constants = __esm({
|
|
3143
3143
|
"src/constants.ts"() {
|
|
3144
3144
|
"use strict";
|
|
@@ -3152,6 +3152,7 @@ var init_constants = __esm({
|
|
|
3152
3152
|
WASM_DIST_DIR = "static/wasm";
|
|
3153
3153
|
IMAGE_DIST_DIR = "static/image";
|
|
3154
3154
|
MEDIA_DIST_DIR = "static/media";
|
|
3155
|
+
ASSETS_DIST_DIR = "static/assets";
|
|
3155
3156
|
LOADER_PATH = (0, import_node_path.join)(__dirname);
|
|
3156
3157
|
STATIC_PATH = (0, import_node_path.join)(__dirname, "../static");
|
|
3157
3158
|
COMPILED_PATH = (0, import_node_path.join)(__dirname, "../compiled");
|
|
@@ -3689,6 +3690,8 @@ function getFilename(config, type, isProd, isServer) {
|
|
|
3689
3690
|
return filename.image ?? `[name]${hash}[ext]`;
|
|
3690
3691
|
case "media":
|
|
3691
3692
|
return filename.media ?? `[name]${hash}[ext]`;
|
|
3693
|
+
case "assets":
|
|
3694
|
+
return filename.assets ?? `[name]${hash}[ext]`;
|
|
3692
3695
|
default:
|
|
3693
3696
|
throw new Error(`unknown key ${type} in "output.filename"`);
|
|
3694
3697
|
}
|
|
@@ -4186,7 +4189,7 @@ function stringifyConfig(config, verbose) {
|
|
|
4186
4189
|
const stringify = import_rspack_chain.default.toString;
|
|
4187
4190
|
return stringify(config, { verbose });
|
|
4188
4191
|
}
|
|
4189
|
-
var import_node_fs2, import_node_path6, import_picocolors5, import_rspack_chain, getDefaultDevConfig, getDefaultServerConfig, getDefaultSourceConfig, getDefaultHtmlConfig, getDefaultSecurityConfig, getDefaultToolsConfig, getDefaultPerformanceConfig, getDefaultOutputConfig, createDefaultConfig, withDefaultConfig, normalizeConfig, resolveConfigPath, getRsbuildInspectConfig, normalizePublicDirs;
|
|
4192
|
+
var import_node_fs2, import_node_path6, import_picocolors5, import_rspack_chain, getDefaultDevConfig, getDefaultServerConfig, swcHelpersPath, getDefaultSourceConfig, getDefaultHtmlConfig, getDefaultSecurityConfig, getDefaultToolsConfig, getDefaultPerformanceConfig, getDefaultOutputConfig, createDefaultConfig, withDefaultConfig, normalizeConfig, resolveConfigPath, getRsbuildInspectConfig, normalizePublicDirs;
|
|
4190
4193
|
var init_config = __esm({
|
|
4191
4194
|
"src/config.ts"() {
|
|
4192
4195
|
"use strict";
|
|
@@ -4224,15 +4227,22 @@ var init_config = __esm({
|
|
|
4224
4227
|
printUrls: true,
|
|
4225
4228
|
strictPort: false
|
|
4226
4229
|
});
|
|
4227
|
-
getDefaultSourceConfig = () =>
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
aliasStrategy: "prefer-tsconfig",
|
|
4231
|
-
preEntry: [],
|
|
4232
|
-
decorators: {
|
|
4233
|
-
version: "2022-03"
|
|
4230
|
+
getDefaultSourceConfig = () => {
|
|
4231
|
+
if (!swcHelpersPath) {
|
|
4232
|
+
swcHelpersPath = (0, import_node_path6.dirname)(require.resolve("@swc/helpers/package.json"));
|
|
4234
4233
|
}
|
|
4235
|
-
|
|
4234
|
+
return {
|
|
4235
|
+
alias: {
|
|
4236
|
+
"@swc/helpers": swcHelpersPath
|
|
4237
|
+
},
|
|
4238
|
+
define: {},
|
|
4239
|
+
aliasStrategy: "prefer-tsconfig",
|
|
4240
|
+
preEntry: [],
|
|
4241
|
+
decorators: {
|
|
4242
|
+
version: "2022-03"
|
|
4243
|
+
}
|
|
4244
|
+
};
|
|
4245
|
+
};
|
|
4236
4246
|
getDefaultHtmlConfig = () => ({
|
|
4237
4247
|
meta: {
|
|
4238
4248
|
charset: { charset: "UTF-8" },
|
|
@@ -4280,7 +4290,8 @@ var init_config = __esm({
|
|
|
4280
4290
|
html: HTML_DIST_DIR,
|
|
4281
4291
|
wasm: WASM_DIST_DIR,
|
|
4282
4292
|
image: IMAGE_DIST_DIR,
|
|
4283
|
-
media: MEDIA_DIST_DIR
|
|
4293
|
+
media: MEDIA_DIST_DIR,
|
|
4294
|
+
assets: ASSETS_DIST_DIR
|
|
4284
4295
|
},
|
|
4285
4296
|
// Temporary placeholder, default: `${server.base}`
|
|
4286
4297
|
assetPrefix: DEFAULT_ASSET_PREFIX,
|
|
@@ -4883,11 +4894,13 @@ function loadEnv({
|
|
|
4883
4894
|
}
|
|
4884
4895
|
(0, import_dotenv_expand.expand)({ parsed });
|
|
4885
4896
|
const publicVars = {};
|
|
4897
|
+
const rawPublicVars = {};
|
|
4886
4898
|
for (const key of Object.keys(process.env)) {
|
|
4887
4899
|
if (prefixes.some((prefix) => key.startsWith(prefix))) {
|
|
4888
4900
|
const val = process.env[key];
|
|
4889
4901
|
publicVars[`import.meta.env.${key}`] = JSON.stringify(val);
|
|
4890
4902
|
publicVars[`process.env.${key}`] = JSON.stringify(val);
|
|
4903
|
+
rawPublicVars[key] = val;
|
|
4891
4904
|
}
|
|
4892
4905
|
}
|
|
4893
4906
|
let cleaned = false;
|
|
@@ -4909,7 +4922,8 @@ function loadEnv({
|
|
|
4909
4922
|
parsed,
|
|
4910
4923
|
cleanup,
|
|
4911
4924
|
filePaths,
|
|
4912
|
-
publicVars
|
|
4925
|
+
publicVars,
|
|
4926
|
+
rawPublicVars
|
|
4913
4927
|
};
|
|
4914
4928
|
}
|
|
4915
4929
|
var import_node_fs3, import_node_path7, import_dotenv, import_dotenv_expand;
|
|
@@ -6004,7 +6018,7 @@ async function createContext(options, userConfig, bundlerType) {
|
|
|
6004
6018
|
const rsbuildConfig = await withDefaultConfig(rootPath, userConfig);
|
|
6005
6019
|
const cachePath = (0, import_node_path10.join)(rootPath, "node_modules", ".cache");
|
|
6006
6020
|
return {
|
|
6007
|
-
version: "1.0.
|
|
6021
|
+
version: "1.0.15",
|
|
6008
6022
|
rootPath,
|
|
6009
6023
|
distPath: "",
|
|
6010
6024
|
cachePath,
|
|
@@ -7404,11 +7418,12 @@ var init_environment = __esm({
|
|
|
7404
7418
|
|
|
7405
7419
|
// src/server/helper.ts
|
|
7406
7420
|
function getURLMessages(urls, routes) {
|
|
7407
|
-
if (routes.length
|
|
7421
|
+
if (routes.length <= 1) {
|
|
7422
|
+
const pathname = routes.length ? routes[0].pathname : "";
|
|
7408
7423
|
return urls.map(({ label, url: url2 }) => {
|
|
7409
|
-
const
|
|
7424
|
+
const normalizedPathname = normalizeUrl(`${url2}${pathname}`);
|
|
7410
7425
|
const prefix = `➜ ${import_picocolors11.default.dim(label.padEnd(10))}`;
|
|
7411
|
-
return ` ${prefix}${import_picocolors11.default.cyan(
|
|
7426
|
+
return ` ${prefix}${import_picocolors11.default.cyan(normalizedPathname)}
|
|
7412
7427
|
`;
|
|
7413
7428
|
}).join("");
|
|
7414
7429
|
}
|
|
@@ -7441,7 +7456,8 @@ function printServerURLs({
|
|
|
7441
7456
|
return null;
|
|
7442
7457
|
}
|
|
7443
7458
|
let urls = originalUrls;
|
|
7444
|
-
|
|
7459
|
+
const useCustomUrl = isFunction(printUrls);
|
|
7460
|
+
if (useCustomUrl) {
|
|
7445
7461
|
const newUrls = printUrls({
|
|
7446
7462
|
urls: urls.map((item) => item.url),
|
|
7447
7463
|
port,
|
|
@@ -7461,7 +7477,10 @@ function printServerURLs({
|
|
|
7461
7477
|
label: getUrlLabel(url2)
|
|
7462
7478
|
}));
|
|
7463
7479
|
}
|
|
7464
|
-
if (urls.length === 0
|
|
7480
|
+
if (urls.length === 0) {
|
|
7481
|
+
return null;
|
|
7482
|
+
}
|
|
7483
|
+
if (routes.length === 0 && !useCustomUrl) {
|
|
7465
7484
|
return null;
|
|
7466
7485
|
}
|
|
7467
7486
|
let message = getURLMessages(urls, routes);
|
|
@@ -10279,10 +10298,13 @@ var init_asset = __esm({
|
|
|
10279
10298
|
setup(api) {
|
|
10280
10299
|
api.modifyBundlerChain((chain, { isProd, environment }) => {
|
|
10281
10300
|
const { config } = environment;
|
|
10282
|
-
const
|
|
10283
|
-
const regExp = getRegExpForExts(exts);
|
|
10301
|
+
const getMergedFilename = (assetType) => {
|
|
10284
10302
|
const distDir = config.output.distPath[assetType];
|
|
10285
10303
|
const filename = getFilename(config, assetType, isProd);
|
|
10304
|
+
return import_node_path25.default.posix.join(distDir, filename);
|
|
10305
|
+
};
|
|
10306
|
+
const createAssetRule = (assetType, exts, emit) => {
|
|
10307
|
+
const regExp = getRegExpForExts(exts);
|
|
10286
10308
|
const { dataUriLimit } = config.output;
|
|
10287
10309
|
const maxSize = typeof dataUriLimit === "number" ? dataUriLimit : dataUriLimit[assetType];
|
|
10288
10310
|
const rule = chain.module.rule(assetType).test(regExp);
|
|
@@ -10290,7 +10312,7 @@ var init_asset = __esm({
|
|
|
10290
10312
|
emit,
|
|
10291
10313
|
rule,
|
|
10292
10314
|
maxSize,
|
|
10293
|
-
filename:
|
|
10315
|
+
filename: getMergedFilename(assetType),
|
|
10294
10316
|
assetType
|
|
10295
10317
|
});
|
|
10296
10318
|
};
|
|
@@ -10303,6 +10325,11 @@ var init_asset = __esm({
|
|
|
10303
10325
|
emitAssets
|
|
10304
10326
|
);
|
|
10305
10327
|
createAssetRule("font", FONT_EXTENSIONS, emitAssets);
|
|
10328
|
+
const assetsFilename = getMergedFilename("assets");
|
|
10329
|
+
chain.output.assetModuleFilename(assetsFilename);
|
|
10330
|
+
if (!emitAssets) {
|
|
10331
|
+
chain.module.generator.merge({ "asset/resource": { emit: false } });
|
|
10332
|
+
}
|
|
10306
10333
|
});
|
|
10307
10334
|
}
|
|
10308
10335
|
});
|
|
@@ -10451,13 +10478,15 @@ var init_RsbuildHtmlPlugin = __esm({
|
|
|
10451
10478
|
return data;
|
|
10452
10479
|
};
|
|
10453
10480
|
addTitleTag = (headTags, title = "") => {
|
|
10454
|
-
|
|
10455
|
-
|
|
10456
|
-
|
|
10457
|
-
|
|
10458
|
-
|
|
10459
|
-
|
|
10460
|
-
|
|
10481
|
+
if (title !== "" && title !== void 0) {
|
|
10482
|
+
headTags.unshift({
|
|
10483
|
+
tagName: "title",
|
|
10484
|
+
innerHTML: title,
|
|
10485
|
+
attributes: {},
|
|
10486
|
+
voidTag: false,
|
|
10487
|
+
meta: {}
|
|
10488
|
+
});
|
|
10489
|
+
}
|
|
10461
10490
|
};
|
|
10462
10491
|
RsbuildHtmlPlugin = class {
|
|
10463
10492
|
constructor(options, getEnvironment, modifyTagsFn) {
|
|
@@ -11378,12 +11407,6 @@ var init_swc = __esm({
|
|
|
11378
11407
|
const swcConfig = getDefaultSwcConfig(browserslist, cacheRoot);
|
|
11379
11408
|
applyTransformImport(swcConfig, config.source.transformImport);
|
|
11380
11409
|
applySwcDecoratorConfig(swcConfig, config);
|
|
11381
|
-
if (swcConfig.jsc?.externalHelpers) {
|
|
11382
|
-
chain.resolve.alias.set(
|
|
11383
|
-
"@swc/helpers",
|
|
11384
|
-
import_node_path31.default.dirname(require.resolve("@swc/helpers/package.json"))
|
|
11385
|
-
);
|
|
11386
|
-
}
|
|
11387
11410
|
if (isWebTarget(target)) {
|
|
11388
11411
|
const polyfillMode = config.output.polyfill;
|
|
11389
11412
|
if (polyfillMode === "off") {
|
|
@@ -13541,7 +13564,7 @@ var init_init = __esm({
|
|
|
13541
13564
|
|
|
13542
13565
|
// src/cli/commands.ts
|
|
13543
13566
|
function runCli() {
|
|
13544
|
-
program.name("rsbuild").usage("<command> [options]").version("1.0.
|
|
13567
|
+
program.name("rsbuild").usage("<command> [options]").version("1.0.15");
|
|
13545
13568
|
const devCommand = program.command("dev");
|
|
13546
13569
|
const buildCommand = program.command("build");
|
|
13547
13570
|
const previewCommand = program.command("preview");
|
|
@@ -13650,7 +13673,7 @@ function prepareCli() {
|
|
|
13650
13673
|
if (!npm_execpath || npm_execpath.includes("npx-cli.js") || npm_execpath.includes(".bun")) {
|
|
13651
13674
|
console.log();
|
|
13652
13675
|
}
|
|
13653
|
-
import_rslog.logger.greet(` ${`Rsbuild v${"1.0.
|
|
13676
|
+
import_rslog.logger.greet(` ${`Rsbuild v${"1.0.15"}`}
|
|
13654
13677
|
`);
|
|
13655
13678
|
}
|
|
13656
13679
|
var import_node_module;
|
|
@@ -13736,7 +13759,7 @@ init_logger();
|
|
|
13736
13759
|
init_mergeConfig();
|
|
13737
13760
|
init_helpers();
|
|
13738
13761
|
init_constants();
|
|
13739
|
-
var version = "1.0.
|
|
13762
|
+
var version = "1.0.15";
|
|
13740
13763
|
// Annotate the CommonJS export names for ESM import in node:
|
|
13741
13764
|
0 && (module.exports = {
|
|
13742
13765
|
PLUGIN_CSS_NAME,
|
package/dist/index.js
CHANGED
|
@@ -46,12 +46,12 @@ var __publicField = (obj, key, value) => {
|
|
|
46
46
|
return value;
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
// ../../node_modules/.pnpm/@modern-js+module-tools@2.60.
|
|
49
|
+
// ../../node_modules/.pnpm/@modern-js+module-tools@2.60.3_typescript@5.6.3/node_modules/@modern-js/module-tools/shims/esm.js
|
|
50
50
|
import path from "path";
|
|
51
51
|
import { fileURLToPath } from "url";
|
|
52
52
|
var getFilename, getDirname, __dirname, __filename;
|
|
53
53
|
var init_esm = __esm({
|
|
54
|
-
"../../node_modules/.pnpm/@modern-js+module-tools@2.60.
|
|
54
|
+
"../../node_modules/.pnpm/@modern-js+module-tools@2.60.3_typescript@5.6.3/node_modules/@modern-js/module-tools/shims/esm.js"() {
|
|
55
55
|
"use strict";
|
|
56
56
|
getFilename = () => fileURLToPath(import.meta.url);
|
|
57
57
|
getDirname = () => path.dirname(getFilename());
|
|
@@ -3170,7 +3170,7 @@ var init_logger = __esm({
|
|
|
3170
3170
|
|
|
3171
3171
|
// src/constants.ts
|
|
3172
3172
|
import { join } from "path";
|
|
3173
|
-
var ROOT_DIST_DIR, HTML_DIST_DIR, JS_DIST_DIR, CSS_DIST_DIR, SVG_DIST_DIR, FONT_DIST_DIR, WASM_DIST_DIR, IMAGE_DIST_DIR, MEDIA_DIST_DIR, LOADER_PATH, STATIC_PATH, COMPILED_PATH, TS_CONFIG_FILE, HMR_SOCKET_PATH, RSBUILD_OUTPUTS_PATH, DEFAULT_PORT, DEFAULT_DATA_URL_SIZE, DEFAULT_MOUNT_ID, DEFAULT_DEV_HOST, DEFAULT_ASSET_PREFIX, DEFAULT_WEB_BROWSERSLIST, DEFAULT_BROWSERSLIST, HTML_REGEX, JS_REGEX, SCRIPT_REGEX, CSS_REGEX, NODE_MODULES_REGEX, PLUGIN_SWC_NAME, PLUGIN_CSS_NAME, FONT_EXTENSIONS, IMAGE_EXTENSIONS, VIDEO_EXTENSIONS, AUDIO_EXTENSIONS;
|
|
3173
|
+
var ROOT_DIST_DIR, HTML_DIST_DIR, JS_DIST_DIR, CSS_DIST_DIR, SVG_DIST_DIR, FONT_DIST_DIR, WASM_DIST_DIR, IMAGE_DIST_DIR, MEDIA_DIST_DIR, ASSETS_DIST_DIR, LOADER_PATH, STATIC_PATH, COMPILED_PATH, TS_CONFIG_FILE, HMR_SOCKET_PATH, RSBUILD_OUTPUTS_PATH, DEFAULT_PORT, DEFAULT_DATA_URL_SIZE, DEFAULT_MOUNT_ID, DEFAULT_DEV_HOST, DEFAULT_ASSET_PREFIX, DEFAULT_WEB_BROWSERSLIST, DEFAULT_BROWSERSLIST, HTML_REGEX, JS_REGEX, SCRIPT_REGEX, CSS_REGEX, NODE_MODULES_REGEX, PLUGIN_SWC_NAME, PLUGIN_CSS_NAME, FONT_EXTENSIONS, IMAGE_EXTENSIONS, VIDEO_EXTENSIONS, AUDIO_EXTENSIONS;
|
|
3174
3174
|
var init_constants = __esm({
|
|
3175
3175
|
"src/constants.ts"() {
|
|
3176
3176
|
"use strict";
|
|
@@ -3184,6 +3184,7 @@ var init_constants = __esm({
|
|
|
3184
3184
|
WASM_DIST_DIR = "static/wasm";
|
|
3185
3185
|
IMAGE_DIST_DIR = "static/image";
|
|
3186
3186
|
MEDIA_DIST_DIR = "static/media";
|
|
3187
|
+
ASSETS_DIST_DIR = "static/assets";
|
|
3187
3188
|
LOADER_PATH = join(__dirname);
|
|
3188
3189
|
STATIC_PATH = join(__dirname, "../static");
|
|
3189
3190
|
COMPILED_PATH = join(__dirname, "../compiled");
|
|
@@ -3728,6 +3729,8 @@ function getFilename2(config, type, isProd, isServer) {
|
|
|
3728
3729
|
return filename.image ?? `[name]${hash}[ext]`;
|
|
3729
3730
|
case "media":
|
|
3730
3731
|
return filename.media ?? `[name]${hash}[ext]`;
|
|
3732
|
+
case "assets":
|
|
3733
|
+
return filename.assets ?? `[name]${hash}[ext]`;
|
|
3731
3734
|
default:
|
|
3732
3735
|
throw new Error(`unknown key ${type} in "output.filename"`);
|
|
3733
3736
|
}
|
|
@@ -4049,7 +4052,7 @@ var init_restart = __esm({
|
|
|
4049
4052
|
|
|
4050
4053
|
// src/config.ts
|
|
4051
4054
|
import fs2 from "fs";
|
|
4052
|
-
import { isAbsolute as isAbsolute2, join as join3 } from "path";
|
|
4055
|
+
import { dirname, isAbsolute as isAbsolute2, join as join3 } from "path";
|
|
4053
4056
|
import color5 from "../compiled/picocolors/index.js";
|
|
4054
4057
|
import RspackChain from "../compiled/rspack-chain/index.js";
|
|
4055
4058
|
function getDefaultEntry(root) {
|
|
@@ -4230,7 +4233,7 @@ function stringifyConfig(config, verbose) {
|
|
|
4230
4233
|
const stringify = RspackChain.toString;
|
|
4231
4234
|
return stringify(config, { verbose });
|
|
4232
4235
|
}
|
|
4233
|
-
var getDefaultDevConfig, getDefaultServerConfig, getDefaultSourceConfig, getDefaultHtmlConfig, getDefaultSecurityConfig, getDefaultToolsConfig, getDefaultPerformanceConfig, getDefaultOutputConfig, createDefaultConfig, withDefaultConfig, normalizeConfig, resolveConfigPath, getRsbuildInspectConfig, normalizePublicDirs;
|
|
4236
|
+
var getDefaultDevConfig, getDefaultServerConfig, swcHelpersPath, getDefaultSourceConfig, getDefaultHtmlConfig, getDefaultSecurityConfig, getDefaultToolsConfig, getDefaultPerformanceConfig, getDefaultOutputConfig, createDefaultConfig, withDefaultConfig, normalizeConfig, resolveConfigPath, getRsbuildInspectConfig, normalizePublicDirs;
|
|
4234
4237
|
var init_config = __esm({
|
|
4235
4238
|
"src/config.ts"() {
|
|
4236
4239
|
"use strict";
|
|
@@ -4265,15 +4268,22 @@ var init_config = __esm({
|
|
|
4265
4268
|
printUrls: true,
|
|
4266
4269
|
strictPort: false
|
|
4267
4270
|
});
|
|
4268
|
-
getDefaultSourceConfig = () =>
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
aliasStrategy: "prefer-tsconfig",
|
|
4272
|
-
preEntry: [],
|
|
4273
|
-
decorators: {
|
|
4274
|
-
version: "2022-03"
|
|
4271
|
+
getDefaultSourceConfig = () => {
|
|
4272
|
+
if (!swcHelpersPath) {
|
|
4273
|
+
swcHelpersPath = dirname(__require.resolve("@swc/helpers/package.json"));
|
|
4275
4274
|
}
|
|
4276
|
-
|
|
4275
|
+
return {
|
|
4276
|
+
alias: {
|
|
4277
|
+
"@swc/helpers": swcHelpersPath
|
|
4278
|
+
},
|
|
4279
|
+
define: {},
|
|
4280
|
+
aliasStrategy: "prefer-tsconfig",
|
|
4281
|
+
preEntry: [],
|
|
4282
|
+
decorators: {
|
|
4283
|
+
version: "2022-03"
|
|
4284
|
+
}
|
|
4285
|
+
};
|
|
4286
|
+
};
|
|
4277
4287
|
getDefaultHtmlConfig = () => ({
|
|
4278
4288
|
meta: {
|
|
4279
4289
|
charset: { charset: "UTF-8" },
|
|
@@ -4321,7 +4331,8 @@ var init_config = __esm({
|
|
|
4321
4331
|
html: HTML_DIST_DIR,
|
|
4322
4332
|
wasm: WASM_DIST_DIR,
|
|
4323
4333
|
image: IMAGE_DIST_DIR,
|
|
4324
|
-
media: MEDIA_DIST_DIR
|
|
4334
|
+
media: MEDIA_DIST_DIR,
|
|
4335
|
+
assets: ASSETS_DIST_DIR
|
|
4325
4336
|
},
|
|
4326
4337
|
// Temporary placeholder, default: `${server.base}`
|
|
4327
4338
|
assetPrefix: DEFAULT_ASSET_PREFIX,
|
|
@@ -4928,11 +4939,13 @@ function loadEnv({
|
|
|
4928
4939
|
}
|
|
4929
4940
|
(0, import_dotenv_expand.expand)({ parsed });
|
|
4930
4941
|
const publicVars = {};
|
|
4942
|
+
const rawPublicVars = {};
|
|
4931
4943
|
for (const key of Object.keys(process.env)) {
|
|
4932
4944
|
if (prefixes.some((prefix) => key.startsWith(prefix))) {
|
|
4933
4945
|
const val = process.env[key];
|
|
4934
4946
|
publicVars[`import.meta.env.${key}`] = JSON.stringify(val);
|
|
4935
4947
|
publicVars[`process.env.${key}`] = JSON.stringify(val);
|
|
4948
|
+
rawPublicVars[key] = val;
|
|
4936
4949
|
}
|
|
4937
4950
|
}
|
|
4938
4951
|
let cleaned = false;
|
|
@@ -4954,7 +4967,8 @@ function loadEnv({
|
|
|
4954
4967
|
parsed,
|
|
4955
4968
|
cleanup,
|
|
4956
4969
|
filePaths,
|
|
4957
|
-
publicVars
|
|
4970
|
+
publicVars,
|
|
4971
|
+
rawPublicVars
|
|
4958
4972
|
};
|
|
4959
4973
|
}
|
|
4960
4974
|
var import_dotenv, import_dotenv_expand;
|
|
@@ -6053,7 +6067,7 @@ async function createContext(options, userConfig, bundlerType) {
|
|
|
6053
6067
|
const rsbuildConfig = await withDefaultConfig(rootPath, userConfig);
|
|
6054
6068
|
const cachePath = join6(rootPath, "node_modules", ".cache");
|
|
6055
6069
|
return {
|
|
6056
|
-
version: "1.0.
|
|
6070
|
+
version: "1.0.15",
|
|
6057
6071
|
rootPath,
|
|
6058
6072
|
distPath: "",
|
|
6059
6073
|
cachePath,
|
|
@@ -7470,11 +7484,12 @@ import os from "os";
|
|
|
7470
7484
|
import { posix as posix3 } from "path";
|
|
7471
7485
|
import color11 from "../compiled/picocolors/index.js";
|
|
7472
7486
|
function getURLMessages(urls, routes) {
|
|
7473
|
-
if (routes.length
|
|
7487
|
+
if (routes.length <= 1) {
|
|
7488
|
+
const pathname = routes.length ? routes[0].pathname : "";
|
|
7474
7489
|
return urls.map(({ label, url: url2 }) => {
|
|
7475
|
-
const
|
|
7490
|
+
const normalizedPathname = normalizeUrl(`${url2}${pathname}`);
|
|
7476
7491
|
const prefix = `➜ ${color11.dim(label.padEnd(10))}`;
|
|
7477
|
-
return ` ${prefix}${color11.cyan(
|
|
7492
|
+
return ` ${prefix}${color11.cyan(normalizedPathname)}
|
|
7478
7493
|
`;
|
|
7479
7494
|
}).join("");
|
|
7480
7495
|
}
|
|
@@ -7507,7 +7522,8 @@ function printServerURLs({
|
|
|
7507
7522
|
return null;
|
|
7508
7523
|
}
|
|
7509
7524
|
let urls = originalUrls;
|
|
7510
|
-
|
|
7525
|
+
const useCustomUrl = isFunction(printUrls);
|
|
7526
|
+
if (useCustomUrl) {
|
|
7511
7527
|
const newUrls = printUrls({
|
|
7512
7528
|
urls: urls.map((item) => item.url),
|
|
7513
7529
|
port,
|
|
@@ -7527,7 +7543,10 @@ function printServerURLs({
|
|
|
7527
7543
|
label: getUrlLabel(url2)
|
|
7528
7544
|
}));
|
|
7529
7545
|
}
|
|
7530
|
-
if (urls.length === 0
|
|
7546
|
+
if (urls.length === 0) {
|
|
7547
|
+
return null;
|
|
7548
|
+
}
|
|
7549
|
+
if (routes.length === 0 && !useCustomUrl) {
|
|
7531
7550
|
return null;
|
|
7532
7551
|
}
|
|
7533
7552
|
let message = getURLMessages(urls, routes);
|
|
@@ -10365,10 +10384,13 @@ var init_asset = __esm({
|
|
|
10365
10384
|
setup(api) {
|
|
10366
10385
|
api.modifyBundlerChain((chain, { isProd, environment }) => {
|
|
10367
10386
|
const { config } = environment;
|
|
10368
|
-
const
|
|
10369
|
-
const regExp = getRegExpForExts(exts);
|
|
10387
|
+
const getMergedFilename = (assetType) => {
|
|
10370
10388
|
const distDir = config.output.distPath[assetType];
|
|
10371
10389
|
const filename = getFilename2(config, assetType, isProd);
|
|
10390
|
+
return path12.posix.join(distDir, filename);
|
|
10391
|
+
};
|
|
10392
|
+
const createAssetRule = (assetType, exts, emit) => {
|
|
10393
|
+
const regExp = getRegExpForExts(exts);
|
|
10372
10394
|
const { dataUriLimit } = config.output;
|
|
10373
10395
|
const maxSize = typeof dataUriLimit === "number" ? dataUriLimit : dataUriLimit[assetType];
|
|
10374
10396
|
const rule = chain.module.rule(assetType).test(regExp);
|
|
@@ -10376,7 +10398,7 @@ var init_asset = __esm({
|
|
|
10376
10398
|
emit,
|
|
10377
10399
|
rule,
|
|
10378
10400
|
maxSize,
|
|
10379
|
-
filename:
|
|
10401
|
+
filename: getMergedFilename(assetType),
|
|
10380
10402
|
assetType
|
|
10381
10403
|
});
|
|
10382
10404
|
};
|
|
@@ -10389,6 +10411,11 @@ var init_asset = __esm({
|
|
|
10389
10411
|
emitAssets
|
|
10390
10412
|
);
|
|
10391
10413
|
createAssetRule("font", FONT_EXTENSIONS, emitAssets);
|
|
10414
|
+
const assetsFilename = getMergedFilename("assets");
|
|
10415
|
+
chain.output.assetModuleFilename(assetsFilename);
|
|
10416
|
+
if (!emitAssets) {
|
|
10417
|
+
chain.module.generator.merge({ "asset/resource": { emit: false } });
|
|
10418
|
+
}
|
|
10392
10419
|
});
|
|
10393
10420
|
}
|
|
10394
10421
|
});
|
|
@@ -10538,13 +10565,15 @@ var init_RsbuildHtmlPlugin = __esm({
|
|
|
10538
10565
|
return data;
|
|
10539
10566
|
};
|
|
10540
10567
|
addTitleTag = (headTags, title = "") => {
|
|
10541
|
-
|
|
10542
|
-
|
|
10543
|
-
|
|
10544
|
-
|
|
10545
|
-
|
|
10546
|
-
|
|
10547
|
-
|
|
10568
|
+
if (title !== "" && title !== void 0) {
|
|
10569
|
+
headTags.unshift({
|
|
10570
|
+
tagName: "title",
|
|
10571
|
+
innerHTML: title,
|
|
10572
|
+
attributes: {},
|
|
10573
|
+
voidTag: false,
|
|
10574
|
+
meta: {}
|
|
10575
|
+
});
|
|
10576
|
+
}
|
|
10548
10577
|
};
|
|
10549
10578
|
RsbuildHtmlPlugin = class {
|
|
10550
10579
|
constructor(options, getEnvironment, modifyTagsFn) {
|
|
@@ -11474,12 +11503,6 @@ var init_swc = __esm({
|
|
|
11474
11503
|
const swcConfig = getDefaultSwcConfig(browserslist, cacheRoot);
|
|
11475
11504
|
applyTransformImport(swcConfig, config.source.transformImport);
|
|
11476
11505
|
applySwcDecoratorConfig(swcConfig, config);
|
|
11477
|
-
if (swcConfig.jsc?.externalHelpers) {
|
|
11478
|
-
chain.resolve.alias.set(
|
|
11479
|
-
"@swc/helpers",
|
|
11480
|
-
path17.dirname(__require.resolve("@swc/helpers/package.json"))
|
|
11481
|
-
);
|
|
11482
|
-
}
|
|
11483
11506
|
if (isWebTarget(target)) {
|
|
11484
11507
|
const polyfillMode = config.output.polyfill;
|
|
11485
11508
|
if (polyfillMode === "off") {
|
|
@@ -13659,7 +13682,7 @@ var init_init = __esm({
|
|
|
13659
13682
|
|
|
13660
13683
|
// src/cli/commands.ts
|
|
13661
13684
|
function runCli() {
|
|
13662
|
-
program.name("rsbuild").usage("<command> [options]").version("1.0.
|
|
13685
|
+
program.name("rsbuild").usage("<command> [options]").version("1.0.15");
|
|
13663
13686
|
const devCommand = program.command("dev");
|
|
13664
13687
|
const buildCommand = program.command("build");
|
|
13665
13688
|
const previewCommand = program.command("preview");
|
|
@@ -13770,7 +13793,7 @@ function prepareCli() {
|
|
|
13770
13793
|
if (!npm_execpath || npm_execpath.includes("npx-cli.js") || npm_execpath.includes(".bun")) {
|
|
13771
13794
|
console.log();
|
|
13772
13795
|
}
|
|
13773
|
-
logger.greet(` ${`Rsbuild v${"1.0.
|
|
13796
|
+
logger.greet(` ${`Rsbuild v${"1.0.15"}`}
|
|
13774
13797
|
`);
|
|
13775
13798
|
}
|
|
13776
13799
|
var init_prepare = __esm({
|
|
@@ -13841,7 +13864,7 @@ init_mergeConfig();
|
|
|
13841
13864
|
init_helpers();
|
|
13842
13865
|
init_constants();
|
|
13843
13866
|
import { rspack as rspack10 } from "@rspack/core";
|
|
13844
|
-
var version = "1.0.
|
|
13867
|
+
var version = "1.0.15";
|
|
13845
13868
|
export {
|
|
13846
13869
|
PLUGIN_CSS_NAME,
|
|
13847
13870
|
PLUGIN_SWC_NAME,
|
|
@@ -7,6 +7,7 @@ export declare const FONT_DIST_DIR = "static/font";
|
|
|
7
7
|
export declare const WASM_DIST_DIR = "static/wasm";
|
|
8
8
|
export declare const IMAGE_DIST_DIR = "static/image";
|
|
9
9
|
export declare const MEDIA_DIST_DIR = "static/media";
|
|
10
|
+
export declare const ASSETS_DIST_DIR = "static/assets";
|
|
10
11
|
export declare const LOADER_PATH: string;
|
|
11
12
|
export declare const STATIC_PATH: string;
|
|
12
13
|
export declare const COMPILED_PATH: string;
|
package/dist-types/loadEnv.d.ts
CHANGED
|
@@ -16,12 +16,35 @@ export type LoadEnvOptions = {
|
|
|
16
16
|
prefixes?: string[];
|
|
17
17
|
};
|
|
18
18
|
export declare function loadEnv({ cwd, mode, prefixes, }?: LoadEnvOptions): {
|
|
19
|
-
/** All
|
|
19
|
+
/** All env variables in the .env file */
|
|
20
20
|
parsed: Record<string, string>;
|
|
21
21
|
/** The absolute paths to all env files */
|
|
22
22
|
filePaths: string[];
|
|
23
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Env variables that start with prefixes.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* {
|
|
29
|
+
* PUBLIC_FOO: 'bar',
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
**/
|
|
33
|
+
rawPublicVars: Record<string, string | undefined>;
|
|
34
|
+
/**
|
|
35
|
+
* Formatted env variables that start with prefixes.
|
|
36
|
+
* The keys contain the prefixes `process.env.*` and `import.meta.env.*`.
|
|
37
|
+
* The values are processed by `JSON.stringify`.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* {
|
|
42
|
+
* 'process.env.PUBLIC_FOO': '"bar"',
|
|
43
|
+
* 'import.meta.env.PUBLIC_FOO': '"bar"',
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
**/
|
|
24
47
|
publicVars: Record<string, string>;
|
|
25
|
-
/** Clear the
|
|
48
|
+
/** Clear the env variables mounted on `process.env` */
|
|
26
49
|
cleanup: () => void;
|
|
27
50
|
};
|
|
@@ -475,6 +475,11 @@ export type DistPathConfig = {
|
|
|
475
475
|
* @default 'static/media'
|
|
476
476
|
*/
|
|
477
477
|
media?: string;
|
|
478
|
+
/**
|
|
479
|
+
* The output directory of assets, except for above (image, svg, font, html, wasm...)
|
|
480
|
+
* @default 'static/assets'
|
|
481
|
+
*/
|
|
482
|
+
assets?: string;
|
|
478
483
|
};
|
|
479
484
|
export type FilenameConfig = {
|
|
480
485
|
/**
|
|
@@ -516,6 +521,11 @@ export type FilenameConfig = {
|
|
|
516
521
|
* @default '[name].[contenthash:8][ext]'
|
|
517
522
|
*/
|
|
518
523
|
media?: string;
|
|
524
|
+
/**
|
|
525
|
+
* the name of other assets, except for above (image, svg, font, html, wasm...)
|
|
526
|
+
* @default '[name].[contenthash:8][ext]'
|
|
527
|
+
*/
|
|
528
|
+
assets?: string;
|
|
519
529
|
};
|
|
520
530
|
export type DataUriLimit = {
|
|
521
531
|
/** The data URI limit of the SVG image. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"description": "The Rspack-based build tool.",
|
|
5
5
|
"homepage": "https://rsbuild.dev",
|
|
6
6
|
"bugs": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"types.d.ts"
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@rspack/core": "~1.0.
|
|
49
|
+
"@rspack/core": "~1.0.13",
|
|
50
50
|
"@rspack/lite-tapable": "~1.0.1",
|
|
51
51
|
"@swc/helpers": "^0.5.13",
|
|
52
52
|
"core-js": "~3.38.1"
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"rslog": "^1.2.3",
|
|
86
86
|
"rspack-chain": "^1.0.3",
|
|
87
87
|
"rspack-manifest-plugin": "5.0.1",
|
|
88
|
-
"sirv": "^
|
|
88
|
+
"sirv": "^3.0.0",
|
|
89
89
|
"style-loader": "3.3.4",
|
|
90
90
|
"tsc-alias": "^1.8.10",
|
|
91
91
|
"typescript": "^5.6.3",
|