@lynx-js/rspeedy 0.14.5 → 0.15.0

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 (67) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/dist/{0~src_plugins_api_plugin_ts.js → 0~api.plugin.js} +3 -4
  3. package/dist/{0~src_plugins_dev_plugin_ts.js → 0~dev.plugin.js} +19 -13
  4. package/dist/{0~src_cli_exit_ts.js → 0~exit.js} +4 -3
  5. package/dist/0~getESVersionTarget.js +33 -0
  6. package/dist/{0~src_plugins_inspect_plugin_ts.js → 0~inspect.plugin.js} +13 -28
  7. package/dist/{0~node_modules_pnpm_ipaddr_js_2_3_0_node_modules_ipaddr_js_lib_ipaddr_js.js → 0~ipaddr.js} +2 -1
  8. package/dist/0~is-lynx.js +5 -0
  9. package/dist/{1~src_plugins_optimization_plugin_ts.js → 0~optimization.plugin.js} +3 -2
  10. package/dist/{0~src_plugins_output_plugin_ts.js → 0~output.plugin.js} +14 -3
  11. package/dist/0~plugins.js +40 -0
  12. package/dist/{0~src_plugins_rsdoctor_plugin_ts.js → 0~rsdoctor.plugin.js} +1 -1
  13. package/dist/{1~src_plugins_sourcemap_plugin_ts.js → 0~sourcemap.plugin.js} +19 -2
  14. package/dist/0~statsJson.plugin.js +26 -0
  15. package/dist/0~swc.plugin.js +25 -0
  16. package/dist/{0~src_plugins_target_plugin_ts.js → 0~target.plugin.js} +4 -4
  17. package/dist/{1~src_config_validate_ts.js → 0~validate.js} +17963 -28527
  18. package/dist/{1~src_plugins_api_plugin_ts.js → 1~api.plugin.js} +3 -4
  19. package/dist/{1~src_cli_build_ts.js → 1~build.js} +7 -7
  20. package/dist/{1~node_modules_pnpm_chokidar_4_0_3_node_modules_chokidar_esm_index_js.js → 1~chokidar.js} +47 -47
  21. package/dist/{1~src_cli_commands_ts.js → 1~commands.js} +7 -17
  22. package/dist/{1~src_cli_dev_ts.js → 1~dev.js} +6 -6
  23. package/dist/{1~src_plugins_dev_plugin_ts.js → 1~dev.plugin.js} +20 -16
  24. package/dist/{1~node_modules_pnpm_commander_13_1_0_node_modules_commander_esm_mjs.js → 1~esm.js} +33 -29
  25. package/dist/1~getESVersionTarget.js +33 -0
  26. package/dist/{1~src_cli_inspect_ts.js → 1~inspect.js} +2 -1
  27. package/dist/{1~src_plugins_inspect_plugin_ts.js → 1~inspect.plugin.js} +15 -32
  28. package/dist/{1~node_modules_pnpm_ipaddr_js_2_3_0_node_modules_ipaddr_js_lib_ipaddr_js.js → 1~ipaddr.js} +2 -1
  29. package/dist/1~is-lynx.js +5 -0
  30. package/dist/{1~src_plugins_minify_plugin_ts.js → 1~minify.plugin.js} +2 -1
  31. package/dist/{0~src_plugins_optimization_plugin_ts.js → 1~optimization.plugin.js} +3 -2
  32. package/dist/{1~src_plugins_output_plugin_ts.js → 1~output.plugin.js} +14 -3
  33. package/dist/1~plugins.js +40 -0
  34. package/dist/{1~src_cli_preview_ts.js → 1~preview.js} +5 -5
  35. package/dist/{1~src_plugins_rsdoctor_plugin_ts.js → 1~rsdoctor.plugin.js} +2 -2
  36. package/dist/{0~src_plugins_sourcemap_plugin_ts.js → 1~sourcemap.plugin.js} +19 -2
  37. package/dist/1~src_cli_init_ts-src_create-rspeedy_ts.js +43 -29
  38. package/dist/1~statsJson.plugin.js +26 -0
  39. package/dist/1~swc.plugin.js +25 -0
  40. package/dist/{1~src_plugins_target_plugin_ts.js → 1~target.plugin.js} +4 -4
  41. package/dist/{0~src_config_validate_ts.js → 1~validate.js} +17963 -28527
  42. package/dist/{1~src_cli_watch_ts.js → 1~watch.js} +1 -3
  43. package/dist/cli/main.js +1 -1
  44. package/dist/index.d.ts +94 -17
  45. package/dist/{src_cli_main_ts.js → src_cli_main_ts-node_child_process-node_events-node_fs-node_path-node_process.js} +127 -30
  46. package/dist/src_index_ts.js +132 -19
  47. package/package.json +18 -17
  48. package/dist/0~src_plugins_index_ts.js +0 -64
  49. package/dist/0~src_plugins_swc_plugin_ts.js +0 -21
  50. package/dist/0~src_utils_getESVersionTarget_ts.js +0 -4
  51. package/dist/1~node_fs.js +0 -7
  52. package/dist/1~node_path.js +0 -7
  53. package/dist/1~src_plugins_index_ts.js +0 -64
  54. package/dist/1~src_plugins_swc_plugin_ts.js +0 -21
  55. package/dist/1~src_utils_getESVersionTarget_ts.js +0 -4
  56. package/dist/rslib-runtime.js +0 -75
  57. /package/dist/{0~src_plugins_chunkLoading_plugin_ts.js → 0~chunkLoading.plugin.js} +0 -0
  58. /package/dist/{0~src_config_output_dist-path_ts.js → 0~dist-path.js} +0 -0
  59. /package/dist/{0~src_plugins_emitOnErrors_plugin_ts.js → 0~emitOnErrors.plugin.js} +0 -0
  60. /package/dist/{0~src_plugins_minify_plugin_ts.js → 0~minify.plugin.js} +0 -0
  61. /package/dist/{0~src_plugins_resolve_plugin_ts.js → 0~resolve.plugin.js} +0 -0
  62. /package/dist/{1~node_modules_pnpm_chokidar_4_0_3_node_modules_chokidar_esm_index_js.js.LICENSE.txt → 1~chokidar.js.LICENSE.txt} +0 -0
  63. /package/dist/{1~src_plugins_chunkLoading_plugin_ts.js → 1~chunkLoading.plugin.js} +0 -0
  64. /package/dist/{1~src_config_output_dist-path_ts.js → 1~dist-path.js} +0 -0
  65. /package/dist/{1~src_plugins_emitOnErrors_plugin_ts.js → 1~emitOnErrors.plugin.js} +0 -0
  66. /package/dist/{1~src_utils_is-ci_ts.js → 1~is-ci.js} +0 -0
  67. /package/dist/{1~src_plugins_resolve_plugin_ts.js → 1~resolve.plugin.js} +0 -0
@@ -1,9 +1,107 @@
1
- import { __webpack_require__ } from "./rslib-runtime.js";
2
- import node_path, { dirname, extname, isAbsolute, join } from "node:path";
1
+ import node_path, { extname, isAbsolute, join } from "node:path";
3
2
  import { createRsbuild, logger, mergeRsbuildConfig, rspack, version } from "@rsbuild/core";
4
3
  import node_fs from "node:fs";
5
4
  import { pathToFileURL } from "node:url";
6
5
  import { register } from "#register";
6
+ var __webpack_modules__ = {};
7
+ var __webpack_module_cache__ = {};
8
+ function __webpack_require__(moduleId) {
9
+ var cachedModule = __webpack_module_cache__[moduleId];
10
+ if (void 0 !== cachedModule) return cachedModule.exports;
11
+ var module = __webpack_module_cache__[moduleId] = {
12
+ exports: {}
13
+ };
14
+ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
15
+ return module.exports;
16
+ }
17
+ __webpack_require__.m = __webpack_modules__;
18
+ (()=>{
19
+ __webpack_require__.n = (module)=>{
20
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
21
+ __webpack_require__.d(getter, {
22
+ a: getter
23
+ });
24
+ return getter;
25
+ };
26
+ })();
27
+ (()=>{
28
+ var getProto = Object.getPrototypeOf ? (obj)=>Object.getPrototypeOf(obj) : (obj)=>obj.__proto__;
29
+ var leafPrototypes;
30
+ __webpack_require__.t = function(value, mode) {
31
+ if (1 & mode) value = this(value);
32
+ if (8 & mode) return value;
33
+ if ('object' == typeof value && value) {
34
+ if (4 & mode && value.__esModule) return value;
35
+ if (16 & mode && 'function' == typeof value.then) return value;
36
+ }
37
+ var ns = Object.create(null);
38
+ __webpack_require__.r(ns);
39
+ var def = {};
40
+ leafPrototypes = leafPrototypes || [
41
+ null,
42
+ getProto({}),
43
+ getProto([]),
44
+ getProto(getProto)
45
+ ];
46
+ for(var current = 2 & mode && value; ('object' == typeof current || 'function' == typeof current) && !~leafPrototypes.indexOf(current); current = getProto(current))Object.getOwnPropertyNames(current).forEach((key)=>{
47
+ def[key] = ()=>value[key];
48
+ });
49
+ def['default'] = ()=>value;
50
+ __webpack_require__.d(ns, def);
51
+ return ns;
52
+ };
53
+ })();
54
+ (()=>{
55
+ __webpack_require__.d = (exports, getters, values)=>{
56
+ var define = (defs, kind)=>{
57
+ for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
58
+ enumerable: true,
59
+ [kind]: defs[key]
60
+ });
61
+ };
62
+ define(getters, "get");
63
+ define(values, "value");
64
+ };
65
+ })();
66
+ (()=>{
67
+ __webpack_require__.add = function(modules) {
68
+ Object.assign(__webpack_require__.m, modules);
69
+ };
70
+ })();
71
+ var __webpack_require__temp = __webpack_require__;
72
+ (()=>{
73
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
74
+ })();
75
+ (()=>{
76
+ __webpack_require__.r = (exports)=>{
77
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports, Symbol.toStringTag, {
78
+ value: 'Module'
79
+ });
80
+ Object.defineProperty(exports, '__esModule', {
81
+ value: true
82
+ });
83
+ };
84
+ })();
85
+ (()=>{
86
+ var installedChunks = {
87
+ index: 0,
88
+ src_index_ts: 0
89
+ };
90
+ var installChunk = (data)=>{
91
+ var __rspack_esm_ids = data.__rspack_esm_ids;
92
+ var __webpack_modules__ = data.__webpack_modules__;
93
+ var __rspack_esm_runtime = data.__rspack_esm_runtime;
94
+ var moduleId, chunkId, i = 0;
95
+ for(moduleId in __webpack_modules__)if (__webpack_require__.o(__webpack_modules__, moduleId)) __webpack_require__.m[moduleId] = __webpack_modules__[moduleId];
96
+ if (__rspack_esm_runtime) __rspack_esm_runtime(__webpack_require__);
97
+ for(; i < __rspack_esm_ids.length; i++){
98
+ chunkId = __rspack_esm_ids[i];
99
+ if (__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) installedChunks[chunkId][0]();
100
+ installedChunks[__rspack_esm_ids[i]] = 0;
101
+ }
102
+ };
103
+ __webpack_require__.C = installChunk;
104
+ })();
7
105
  __webpack_require__.add({
8
106
  "../../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js" (module) {
9
107
  let p = process || {}, argv = p.argv || [], env = p.env || {};
@@ -95,7 +193,7 @@ const debugList = (prefix, messages)=>debug(()=>`${prefix} ${[
95
193
  ''
96
194
  ].concat(messages).join('\n - ')}`);
97
195
  function applyDefaultRspeedyConfig(config) {
98
- const enableChunkSplitting = config.performance?.chunkSplit?.strategy && config.performance?.chunkSplit?.strategy !== 'all-in-one';
196
+ const enableChunkSplitting = getEnableChunkSplitting(config);
99
197
  return mergeRsbuildConfig({
100
198
  mode: (()=>{
101
199
  if (config.mode) return config.mode;
@@ -124,6 +222,11 @@ function applyDefaultRspeedyConfig(config) {
124
222
  }
125
223
  }, config);
126
224
  }
225
+ function getEnableChunkSplitting(config) {
226
+ if (void 0 !== config.splitChunks) return false !== config.splitChunks;
227
+ const strategy = config.performance?.chunkSplit?.strategy;
228
+ return Boolean(strategy && 'all-in-one' !== strategy);
229
+ }
127
230
  const DEFAULT_FILENAME = '[name].[platform].bundle';
128
231
  function getFilename(filename) {
129
232
  if ('string' == typeof filename) return {
@@ -131,6 +234,9 @@ function getFilename(filename) {
131
234
  template: filename
132
235
  };
133
236
  const finalFilename = filename?.bundle ?? filename?.template ?? DEFAULT_FILENAME;
237
+ if ('function' == typeof finalFilename) return {
238
+ bundle: finalFilename
239
+ };
134
240
  return {
135
241
  bundle: finalFilename,
136
242
  template: finalFilename
@@ -206,13 +312,12 @@ function toRsbuildConfig(config) {
206
312
  sourceMap: config.output?.sourceMap
207
313
  },
208
314
  resolve: {
209
- alias: config.resolve?.alias,
315
+ alias: toRsbuildAlias(config),
210
316
  aliasStrategy: config.resolve?.aliasStrategy,
211
317
  dedupe: config.resolve?.dedupe,
212
318
  extensions: config.resolve?.extensions
213
319
  },
214
320
  source: {
215
- alias: config.source?.alias,
216
321
  assetsInclude: config.source?.assetsInclude,
217
322
  decorators: config.source?.decorators,
218
323
  define: config.source?.define,
@@ -223,12 +328,13 @@ function toRsbuildConfig(config) {
223
328
  transformImport: config.source?.transformImport,
224
329
  tsconfigPath: config.source?.tsconfigPath
225
330
  },
331
+ splitChunks: toRsbuildSplitChunks(config),
226
332
  server: {
227
333
  base: config.server?.base,
228
334
  compress: config.server?.compress,
229
335
  cors: config.server?.cors,
230
336
  headers: config.server?.headers,
231
- host: config.server?.host,
337
+ host: config.server?.host ?? '0.0.0.0',
232
338
  port: config.server?.port,
233
339
  proxy: config.server?.proxy,
234
340
  strictPort: config.server?.strictPort
@@ -237,7 +343,6 @@ function toRsbuildConfig(config) {
237
343
  performance: {
238
344
  buildCache: config.performance?.buildCache,
239
345
  chunkSplit: config.performance?.chunkSplit,
240
- profile: config.performance?.profile,
241
346
  removeConsole: toRsbuildRemoveConsole(config),
242
347
  printFileSize: config.performance?.printFileSize ?? true
243
348
  },
@@ -263,6 +368,21 @@ function toRsbuildRemoveConsole(config) {
263
368
  ];
264
369
  return config.performance?.removeConsole;
265
370
  }
371
+ function toRsbuildSplitChunks(config) {
372
+ if (void 0 !== config.splitChunks) return config.splitChunks;
373
+ const legacyStrategy = config.performance?.chunkSplit?.strategy;
374
+ if (legacyStrategy && 'all-in-one' !== legacyStrategy) return;
375
+ return false;
376
+ }
377
+ function toRsbuildAlias(config) {
378
+ const sourceAlias = config.source?.alias;
379
+ const resolveAlias = config.resolve?.alias;
380
+ if (void 0 === sourceAlias && void 0 === resolveAlias) return;
381
+ return {
382
+ ...resolveAlias,
383
+ ...sourceAlias
384
+ };
385
+ }
266
386
  async function createRspeedy({ cwd = process.cwd(), rspeedyConfig = {}, loadEnv = true, environment = [], callerName = 'rspeedy' }) {
267
387
  const config = applyDefaultRspeedyConfig(rspeedyConfig);
268
388
  const [rspeedy, { applyDefaultPlugins }] = await Promise.all([
@@ -273,9 +393,7 @@ async function createRspeedy({ cwd = process.cwd(), rspeedyConfig = {}, loadEnv
273
393
  environment,
274
394
  callerName
275
395
  }),
276
- import("./0~src_plugins_index_ts.js").then((mod)=>({
277
- applyDefaultPlugins: mod.applyDefaultPlugins
278
- }))
396
+ import("./0~plugins.js")
279
397
  ]);
280
398
  await applyDefaultPlugins(rspeedy, config);
281
399
  const inspectConfig = rspeedy.inspectConfig.bind(rspeedy);
@@ -283,9 +401,7 @@ async function createRspeedy({ cwd = process.cwd(), rspeedyConfig = {}, loadEnv
283
401
  getRspeedyConfig: ()=>config,
284
402
  async inspectConfig (options) {
285
403
  const result = await inspectConfig(options);
286
- const { inspectRspeedyConfig } = await import("./0~src_plugins_inspect_plugin_ts.js").then((mod)=>({
287
- inspectRspeedyConfig: mod.inspectRspeedyConfig
288
- }));
404
+ const { inspectRspeedyConfig } = await import("./0~inspect.plugin.js");
289
405
  await inspectRspeedyConfig(rspeedyConfig, node_path.resolve(options.outputPath ?? rspeedy.context.distPath, '.rsbuild/rspeedy.config.js'), options.verbose ?? false);
290
406
  return result;
291
407
  }
@@ -335,10 +451,7 @@ async function loadConfig(loadConfigOptions) {
335
451
  try {
336
452
  const [exports, { validate }] = await Promise.all([
337
453
  import(`${specifier}?t=${Date.now()}`),
338
- import("./0~src_config_validate_ts.js").then((mod)=>({
339
- validate: mod.validate,
340
- validateConfig: mod.validateConfig
341
- }))
454
+ import("./0~validate.js").then((m)=>m.validate_namespaceObject)
342
455
  ]);
343
456
  const configExport = 'default' in exports ? exports.default : exports;
344
457
  const rawContent = 'function' == typeof configExport ? await configExport({
@@ -377,8 +490,8 @@ function isDeno() {
377
490
  return false;
378
491
  }
379
492
  var package_namespaceObject = {
380
- rE: "0.14.5"
493
+ rE: "0.15.0"
381
494
  };
382
495
  const version_version = package_namespaceObject.rE;
383
496
  const rspackVersion = rspack.rspackVersion;
384
- export { createRspeedy, debug, defineConfig, dirname, isDebug, loadConfig, logger, mergeRsbuildConfig, mergeRspeedyConfig, node_path, rspack, rspackVersion, version as rsbuildVersion, version_version as version };
497
+ export { __webpack_require__temp as __webpack_require__, createRspeedy, debug, defineConfig, isDebug, loadConfig, logger, mergeRspeedyConfig, rspack, rspackVersion, version as rsbuildVersion, version_version as version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/rspeedy",
3
- "version": "0.14.5",
3
+ "version": "0.15.0",
4
4
  "description": "A webpack/rspack-based frontend toolchain for Lynx",
5
5
  "keywords": [
6
6
  "webpack",
@@ -48,36 +48,37 @@
48
48
  "README.md"
49
49
  ],
50
50
  "dependencies": {
51
- "@rsbuild/core": "1.7.5",
52
- "@rsbuild/plugin-css-minimizer": "1.1.1",
51
+ "@rsbuild/core": "2.0.11",
52
+ "@rsbuild/plugin-css-minimizer": "2.0.0",
53
53
  "@rsdoctor/rspack-plugin": "~1.5.6",
54
- "@lynx-js/cache-events-webpack-plugin": "^0.0.3",
55
- "@lynx-js/chunk-loading-webpack-plugin": "^0.3.4",
56
- "@lynx-js/web-rsbuild-server-middleware": "0.21.0",
57
- "@lynx-js/webpack-dev-transport": "^0.2.0",
54
+ "@lynx-js/cache-events-webpack-plugin": "^0.1.0",
55
+ "@lynx-js/chunk-loading-webpack-plugin": "^0.4.0",
56
+ "@lynx-js/debug-metadata-rsbuild-plugin": "^0.1.0",
57
+ "@lynx-js/web-rsbuild-server-middleware": "0.21.1",
58
+ "@lynx-js/webpack-dev-transport": "^0.3.0",
58
59
  "@lynx-js/websocket": "^0.0.4"
59
60
  },
60
61
  "devDependencies": {
61
62
  "@microsoft/api-extractor": "7.58.2",
62
- "@rollup/plugin-typescript": "^12.3.0",
63
63
  "@rsdoctor/core": "~1.5.6",
64
+ "@rstest/core": "0.10.5",
65
+ "@swc/core": "^1.15.30",
64
66
  "chokidar": "^4.0.3",
65
67
  "commander": "^13.1.0",
66
68
  "eventemitter3": "^5.0.4",
67
69
  "exit-hook": "^4.0.0",
70
+ "expect-type": "^1.2.1",
68
71
  "ipaddr.js": "^2.3.0",
69
72
  "javascript-stringify": "^2.1.0",
70
73
  "picocolors": "^1.1.1",
71
- "rsbuild-plugin-arethetypeswrong": "0.2.0",
74
+ "rsbuild-plugin-arethetypeswrong": "0.3.1",
72
75
  "rsbuild-plugin-publint": "0.3.4",
73
76
  "tiny-invariant": "^1.3.3",
74
77
  "ts-blank-space": "^0.7.0",
75
78
  "type-fest": "^5.4.4",
76
- "typia": "10.1.0",
77
- "typia-rspack-plugin": "2.2.2",
78
- "vitest": "^3.2.4",
79
- "webpack": "^5.105.2",
80
- "@lynx-js/vitest-setup": "0.0.0"
79
+ "typia": "12.1.1",
80
+ "typia-rspack-plugin": "3.0.1",
81
+ "@lynx-js/test-tools": "0.0.0"
81
82
  },
82
83
  "peerDependencies": {
83
84
  "typescript": "5.1.6 - 5.9.x"
@@ -88,7 +89,7 @@
88
89
  }
89
90
  },
90
91
  "engines": {
91
- "node": ">=18"
92
+ "node": "^20.19.0 || >=22.12.0"
92
93
  },
93
94
  "publishConfig": {
94
95
  "access": "public"
@@ -97,7 +98,7 @@
97
98
  "scripts": {
98
99
  "api-extractor": "api-extractor run --verbose",
99
100
  "build": "rslib build",
100
- "test": "pnpm -w run test --project rspeedy",
101
- "test:type": "vitest --typecheck.only"
101
+ "test": "rstest",
102
+ "test:type": "tsc --noEmit"
102
103
  }
103
104
  }
@@ -1,64 +0,0 @@
1
- import { debug, isDebug } from "./src_index_ts.js";
2
- async function applyDebugPlugins(rsbuildInstance, config) {
3
- const debugPlugins = Object.freeze([
4
- import("./0~src_plugins_emitOnErrors_plugin_ts.js").then((mod)=>({
5
- pluginEmitOnErrors: mod.pluginEmitOnErrors
6
- })).then(({ pluginEmitOnErrors })=>pluginEmitOnErrors()),
7
- import("./0~src_plugins_inspect_plugin_ts.js").then((mod)=>({
8
- pluginInspect: mod.pluginInspect
9
- })).then(({ pluginInspect })=>pluginInspect(config))
10
- ]);
11
- rsbuildInstance.addPlugins(await Promise.all(debugPlugins));
12
- }
13
- async function applyDefaultPlugins(rsbuildInstance, config) {
14
- const defaultPlugins = Object.freeze([
15
- import("./0~src_plugins_api_plugin_ts.js").then((mod)=>({
16
- pluginAPI: mod.pluginAPI
17
- })).then(({ pluginAPI })=>pluginAPI(config)),
18
- import("./0~src_plugins_chunkLoading_plugin_ts.js").then((mod)=>({
19
- pluginChunkLoading: mod.pluginChunkLoading
20
- })).then(({ pluginChunkLoading })=>pluginChunkLoading()),
21
- import("./0~src_plugins_dev_plugin_ts.js").then((mod)=>({
22
- pluginDev: mod.pluginDev
23
- })).then(({ pluginDev })=>pluginDev(config.dev, config.server)),
24
- import("./0~src_plugins_minify_plugin_ts.js").then((mod)=>({
25
- pluginMinify: mod.pluginMinify
26
- })).then(({ pluginMinify })=>pluginMinify(config.output?.minify)),
27
- import("./0~src_plugins_optimization_plugin_ts.js").then((mod)=>({
28
- pluginOptimization: mod.pluginOptimization
29
- })).then(({ pluginOptimization })=>pluginOptimization()),
30
- import("./0~src_plugins_output_plugin_ts.js").then((mod)=>({
31
- pluginOutput: mod.pluginOutput
32
- })).then(({ pluginOutput })=>pluginOutput(config.output)),
33
- import("./0~src_plugins_resolve_plugin_ts.js").then((mod)=>({
34
- pluginResolve: mod.pluginResolve
35
- })).then(({ pluginResolve })=>pluginResolve()),
36
- import("./0~src_plugins_rsdoctor_plugin_ts.js").then((mod)=>({
37
- pluginRsdoctor: mod.pluginRsdoctor
38
- })).then(({ pluginRsdoctor })=>pluginRsdoctor(config.tools?.rsdoctor)),
39
- import("./0~src_plugins_sourcemap_plugin_ts.js").then((mod)=>({
40
- pluginSourcemap: mod.pluginSourcemap
41
- })).then(({ pluginSourcemap })=>pluginSourcemap()),
42
- import("./0~src_plugins_swc_plugin_ts.js").then((mod)=>({
43
- pluginSwc: mod.pluginSwc
44
- })).then(({ pluginSwc })=>pluginSwc()),
45
- import("./0~src_plugins_target_plugin_ts.js").then((mod)=>({
46
- pluginTarget: mod.pluginTarget
47
- })).then(({ pluginTarget })=>pluginTarget())
48
- ]);
49
- const promises = [
50
- Promise.all(defaultPlugins).then((plugins)=>{
51
- rsbuildInstance.addPlugins(plugins);
52
- })
53
- ];
54
- if (isDebug()) {
55
- debug('apply Rspeedy default debug plugins');
56
- promises.push(applyDebugPlugins(rsbuildInstance, config));
57
- }
58
- await Promise.all(promises);
59
- const { pluginCssMinimizer, PLUGIN_CSS_MINIMIZER_NAME } = await import("@rsbuild/plugin-css-minimizer");
60
- if (!rsbuildInstance.isPluginExists(PLUGIN_CSS_MINIMIZER_NAME)) rsbuildInstance.addPlugins([
61
- pluginCssMinimizer()
62
- ]);
63
- }
64
- export { applyDefaultPlugins };
@@ -1,21 +0,0 @@
1
- import { getESVersionTarget } from "./0~src_utils_getESVersionTarget_ts.js";
2
- function pluginSwc() {
3
- return {
4
- name: 'lynx:rsbuild:swc',
5
- setup (api) {
6
- api.modifyRsbuildConfig((config, { mergeRsbuildConfig })=>{
7
- const isProd = 'production' === config.mode;
8
- return mergeRsbuildConfig(config, {
9
- tools: {
10
- swc (config) {
11
- delete config.env;
12
- config.jsc ??= {};
13
- config.jsc.target ??= getESVersionTarget(isProd);
14
- }
15
- }
16
- });
17
- });
18
- }
19
- };
20
- }
21
- export { pluginSwc };
@@ -1,4 +0,0 @@
1
- function getESVersionTarget(isProd) {
2
- return isProd ? 'es2015' : 'es2019';
3
- }
4
- export { getESVersionTarget };
package/dist/1~node_fs.js DELETED
@@ -1,7 +0,0 @@
1
- import * as __rspack_external_node_fs_5ea92f0c from "node:fs";
2
- import { __webpack_require__ } from "./rslib-runtime.js";
3
- __webpack_require__.add({
4
- "node:fs" (module) {
5
- module.exports = __rspack_external_node_fs_5ea92f0c;
6
- }
7
- });
@@ -1,7 +0,0 @@
1
- import * as __rspack_external_node_path_c5b9b54f from "node:path";
2
- import { __webpack_require__ } from "./rslib-runtime.js";
3
- __webpack_require__.add({
4
- "node:path" (module) {
5
- module.exports = __rspack_external_node_path_c5b9b54f;
6
- }
7
- });
@@ -1,64 +0,0 @@
1
- import { debug, isDebug } from "./src_cli_main_ts.js";
2
- async function applyDebugPlugins(rsbuildInstance, config) {
3
- const debugPlugins = Object.freeze([
4
- import("./1~src_plugins_emitOnErrors_plugin_ts.js").then((mod)=>({
5
- pluginEmitOnErrors: mod.pluginEmitOnErrors
6
- })).then(({ pluginEmitOnErrors })=>pluginEmitOnErrors()),
7
- import("./1~src_plugins_inspect_plugin_ts.js").then((mod)=>({
8
- pluginInspect: mod.pluginInspect
9
- })).then(({ pluginInspect })=>pluginInspect(config))
10
- ]);
11
- rsbuildInstance.addPlugins(await Promise.all(debugPlugins));
12
- }
13
- async function applyDefaultPlugins(rsbuildInstance, config) {
14
- const defaultPlugins = Object.freeze([
15
- import("./1~src_plugins_api_plugin_ts.js").then((mod)=>({
16
- pluginAPI: mod.pluginAPI
17
- })).then(({ pluginAPI })=>pluginAPI(config)),
18
- import("./1~src_plugins_chunkLoading_plugin_ts.js").then((mod)=>({
19
- pluginChunkLoading: mod.pluginChunkLoading
20
- })).then(({ pluginChunkLoading })=>pluginChunkLoading()),
21
- import("./1~src_plugins_dev_plugin_ts.js").then((mod)=>({
22
- pluginDev: mod.pluginDev
23
- })).then(({ pluginDev })=>pluginDev(config.dev, config.server)),
24
- import("./1~src_plugins_minify_plugin_ts.js").then((mod)=>({
25
- pluginMinify: mod.pluginMinify
26
- })).then(({ pluginMinify })=>pluginMinify(config.output?.minify)),
27
- import("./1~src_plugins_optimization_plugin_ts.js").then((mod)=>({
28
- pluginOptimization: mod.pluginOptimization
29
- })).then(({ pluginOptimization })=>pluginOptimization()),
30
- import("./1~src_plugins_output_plugin_ts.js").then((mod)=>({
31
- pluginOutput: mod.pluginOutput
32
- })).then(({ pluginOutput })=>pluginOutput(config.output)),
33
- import("./1~src_plugins_resolve_plugin_ts.js").then((mod)=>({
34
- pluginResolve: mod.pluginResolve
35
- })).then(({ pluginResolve })=>pluginResolve()),
36
- import("./1~src_plugins_rsdoctor_plugin_ts.js").then((mod)=>({
37
- pluginRsdoctor: mod.pluginRsdoctor
38
- })).then(({ pluginRsdoctor })=>pluginRsdoctor(config.tools?.rsdoctor)),
39
- import("./1~src_plugins_sourcemap_plugin_ts.js").then((mod)=>({
40
- pluginSourcemap: mod.pluginSourcemap
41
- })).then(({ pluginSourcemap })=>pluginSourcemap()),
42
- import("./1~src_plugins_swc_plugin_ts.js").then((mod)=>({
43
- pluginSwc: mod.pluginSwc
44
- })).then(({ pluginSwc })=>pluginSwc()),
45
- import("./1~src_plugins_target_plugin_ts.js").then((mod)=>({
46
- pluginTarget: mod.pluginTarget
47
- })).then(({ pluginTarget })=>pluginTarget())
48
- ]);
49
- const promises = [
50
- Promise.all(defaultPlugins).then((plugins)=>{
51
- rsbuildInstance.addPlugins(plugins);
52
- })
53
- ];
54
- if (isDebug()) {
55
- debug('apply Rspeedy default debug plugins');
56
- promises.push(applyDebugPlugins(rsbuildInstance, config));
57
- }
58
- await Promise.all(promises);
59
- const { pluginCssMinimizer, PLUGIN_CSS_MINIMIZER_NAME } = await import("@rsbuild/plugin-css-minimizer");
60
- if (!rsbuildInstance.isPluginExists(PLUGIN_CSS_MINIMIZER_NAME)) rsbuildInstance.addPlugins([
61
- pluginCssMinimizer()
62
- ]);
63
- }
64
- export { applyDefaultPlugins };
@@ -1,21 +0,0 @@
1
- import { getESVersionTarget } from "./1~src_utils_getESVersionTarget_ts.js";
2
- function pluginSwc() {
3
- return {
4
- name: 'lynx:rsbuild:swc',
5
- setup (api) {
6
- api.modifyRsbuildConfig((config, { mergeRsbuildConfig })=>{
7
- const isProd = 'production' === config.mode;
8
- return mergeRsbuildConfig(config, {
9
- tools: {
10
- swc (config) {
11
- delete config.env;
12
- config.jsc ??= {};
13
- config.jsc.target ??= getESVersionTarget(isProd);
14
- }
15
- }
16
- });
17
- });
18
- }
19
- };
20
- }
21
- export { pluginSwc };
@@ -1,4 +0,0 @@
1
- function getESVersionTarget(isProd) {
2
- return isProd ? 'es2015' : 'es2019';
3
- }
4
- export { getESVersionTarget };
@@ -1,75 +0,0 @@
1
- var __webpack_modules__ = {};
2
- var __webpack_module_cache__ = {};
3
- function __webpack_require__(moduleId) {
4
- var cachedModule = __webpack_module_cache__[moduleId];
5
- if (void 0 !== cachedModule) return cachedModule.exports;
6
- var module = __webpack_module_cache__[moduleId] = {
7
- exports: {}
8
- };
9
- __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
10
- return module.exports;
11
- }
12
- __webpack_require__.m = __webpack_modules__;
13
- (()=>{
14
- __webpack_require__.add = function(modules) {
15
- Object.assign(__webpack_require__.m, modules);
16
- };
17
- })();
18
- (()=>{
19
- __webpack_require__.n = (module)=>{
20
- var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
21
- __webpack_require__.d(getter, {
22
- a: getter
23
- });
24
- return getter;
25
- };
26
- })();
27
- (()=>{
28
- var getProto = Object.getPrototypeOf ? (obj)=>Object.getPrototypeOf(obj) : (obj)=>obj.__proto__;
29
- var leafPrototypes;
30
- __webpack_require__.t = function(value, mode) {
31
- if (1 & mode) value = this(value);
32
- if (8 & mode) return value;
33
- if ('object' == typeof value && value) {
34
- if (4 & mode && value.__esModule) return value;
35
- if (16 & mode && 'function' == typeof value.then) return value;
36
- }
37
- var ns = Object.create(null);
38
- __webpack_require__.r(ns);
39
- var def = {};
40
- leafPrototypes = leafPrototypes || [
41
- null,
42
- getProto({}),
43
- getProto([]),
44
- getProto(getProto)
45
- ];
46
- for(var current = 2 & mode && value; ('object' == typeof current || 'function' == typeof current) && !~leafPrototypes.indexOf(current); current = getProto(current))Object.getOwnPropertyNames(current).forEach((key)=>{
47
- def[key] = ()=>value[key];
48
- });
49
- def['default'] = ()=>value;
50
- __webpack_require__.d(ns, def);
51
- return ns;
52
- };
53
- })();
54
- (()=>{
55
- __webpack_require__.d = (exports, definition)=>{
56
- for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
57
- enumerable: true,
58
- get: definition[key]
59
- });
60
- };
61
- })();
62
- (()=>{
63
- __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
64
- })();
65
- (()=>{
66
- __webpack_require__.r = (exports)=>{
67
- if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports, Symbol.toStringTag, {
68
- value: 'Module'
69
- });
70
- Object.defineProperty(exports, '__esModule', {
71
- value: true
72
- });
73
- };
74
- })();
75
- export { __webpack_require__ };
File without changes