@lynx-js/rspeedy-canary 0.10.5 → 0.10.6-canary-20250805-44f5b0de

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @lynx-js/rspeedy
2
2
 
3
+ ## 0.10.6-canary-20250805112836-44f5b0de4352c481bd580b9af1349df3a9e38d31
4
+
5
+ ### Patch Changes
6
+
7
+ - fix deno compatibility ([#1412](https://github.com/lynx-family/lynx-stack/pull/1412))
8
+
3
9
  ## 0.10.5
4
10
 
5
11
  ### Patch Changes
@@ -55,28 +61,28 @@
55
61
 
56
62
  ```ts
57
63
  type InlineChunkTestFunction = (params: {
58
- size: number
59
- name: string
60
- }) => boolean
64
+ size: number;
65
+ name: string;
66
+ }) => boolean;
61
67
 
62
- type InlineChunkTest = RegExp | InlineChunkTestFunction
68
+ type InlineChunkTest = RegExp | InlineChunkTestFunction;
63
69
 
64
70
  type InlineChunkConfig =
65
71
  | boolean
66
72
  | InlineChunkTest
67
- | { enable?: boolean | 'auto', test: InlineChunkTest }
73
+ | { enable?: boolean | "auto"; test: InlineChunkTest };
68
74
  ```
69
75
 
70
76
  ```ts
71
- import { defineConfig } from '@lynx-js/rspeedy'
77
+ import { defineConfig } from "@lynx-js/rspeedy";
72
78
 
73
79
  export default defineConfig({
74
80
  output: {
75
81
  inlineScripts: ({ name, size }) => {
76
- return name.includes('foo') && size < 1000
82
+ return name.includes("foo") && size < 1000;
77
83
  },
78
84
  },
79
- })
85
+ });
80
86
  ```
81
87
 
82
88
  - docs: remove chunks: 'all' in comments ([#1168](https://github.com/lynx-family/lynx-stack/pull/1168))
@@ -119,13 +125,13 @@
119
125
  example:
120
126
 
121
127
  ```js
122
- import { defineConfig } from '@lynx-js/rspeedy'
128
+ import { defineConfig } from "@lynx-js/rspeedy";
123
129
 
124
130
  export default defineConfig({
125
131
  output: {
126
132
  inlineScripts: false,
127
133
  },
128
- })
134
+ });
129
135
  ```
130
136
 
131
137
  - Bump Rsbuild v1.3.21 with Rspack v1.3.11. ([#863](https://github.com/lynx-family/lynx-stack/pull/863))
@@ -145,12 +151,12 @@
145
151
  example:
146
152
 
147
153
  ```js
148
- import { defineConfig } from '@lynx-js/rspeedy'
154
+ import { defineConfig } from "@lynx-js/rspeedy";
149
155
  export default defineConfig({
150
156
  source: {
151
- preEntry: './src/polyfill.ts',
157
+ preEntry: "./src/polyfill.ts",
152
158
  },
153
- })
159
+ });
154
160
  ```
155
161
 
156
162
  - Bump Rsbuild v1.3.20 with Rspack v1.3.10. ([#799](https://github.com/lynx-family/lynx-stack/pull/799))
@@ -161,17 +167,17 @@
161
167
 
162
168
  ```js
163
169
  export const myPlugin = {
164
- name: 'my-plugin',
170
+ name: "my-plugin",
165
171
  setup(api) {
166
- const { callerName } = api.context
172
+ const { callerName } = api.context;
167
173
 
168
- if (callerName === 'rslib') {
174
+ if (callerName === "rslib") {
169
175
  // ...
170
- } else if (callerName === 'rspeedy') {
176
+ } else if (callerName === "rspeedy") {
171
177
  // ...
172
178
  }
173
179
  },
174
- }
180
+ };
175
181
  ```
176
182
 
177
183
  - Support `performance.buildCache`. ([#766](https://github.com/lynx-family/lynx-stack/pull/766))
@@ -194,7 +200,7 @@
194
200
  Set `tools.rsdoctor.experiments.enableNativePlugin` to `false` to use the old JS plugin.
195
201
 
196
202
  ```js
197
- import { defineConfig } from '@lynx-js/rspeedy'
203
+ import { defineConfig } from "@lynx-js/rspeedy";
198
204
 
199
205
  export default defineConfig({
200
206
  tools: {
@@ -204,7 +210,7 @@
204
210
  },
205
211
  },
206
212
  },
207
- })
213
+ });
208
214
  ```
209
215
 
210
216
  See [Rsdoctor - 1.0](https://rsdoctor.dev/blog/release/release-note-1_0#-faster-analysis) for more details.
@@ -336,12 +342,12 @@
336
342
  example:
337
343
 
338
344
  ```js
339
- import { defineConfig } from '@lynx-js/rspeedy'
345
+ import { defineConfig } from "@lynx-js/rspeedy";
340
346
  export default defineConfig({
341
347
  server: {
342
- base: '/dist',
348
+ base: "/dist",
343
349
  },
344
- })
350
+ });
345
351
  ```
346
352
 
347
353
  - Updated dependencies [[`b026c8b`](https://github.com/lynx-family/lynx-stack/commit/b026c8bdcbf7bdcda73e170477297213b447d876)]:
@@ -394,11 +400,11 @@
394
400
  You can switch to other tools by using:
395
401
 
396
402
  ```js
397
- import { defineConfig } from '@lynx-js/rspeedy'
403
+ import { defineConfig } from "@lynx-js/rspeedy";
398
404
  import {
399
405
  CssMinimizerWebpackPlugin,
400
406
  pluginCssMinimizer,
401
- } from '@rsbuild/plugin-css-minimizer'
407
+ } from "@rsbuild/plugin-css-minimizer";
402
408
 
403
409
  export default defineConfig({
404
410
  plugins: [
@@ -411,7 +417,7 @@
411
417
  },
412
418
  }),
413
419
  ],
414
- })
420
+ });
415
421
  ```
416
422
 
417
423
  See [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) for details.
@@ -421,8 +427,8 @@
421
427
  You can use custom options with [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer):
422
428
 
423
429
  ```js
424
- import { defineConfig } from '@lynx-js/rspeedy'
425
- import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
430
+ import { defineConfig } from "@lynx-js/rspeedy";
431
+ import { pluginCssMinimizer } from "@rsbuild/plugin-css-minimizer";
426
432
 
427
433
  export default defineConfig({
428
434
  plugins: [
@@ -434,7 +440,7 @@
434
440
  },
435
441
  }),
436
442
  ],
437
- })
443
+ });
438
444
  ```
439
445
 
440
446
  ## 0.7.1
@@ -454,7 +460,7 @@
454
460
  You may turn it off using `output.minify.css: false`:
455
461
 
456
462
  ```js
457
- import { defineConfig } from '@lynx-js/rspeedy'
463
+ import { defineConfig } from "@lynx-js/rspeedy";
458
464
 
459
465
  export default defineConfig({
460
466
  output: {
@@ -462,18 +468,18 @@
462
468
  css: false,
463
469
  },
464
470
  },
465
- })
471
+ });
466
472
  ```
467
473
 
468
474
  Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
469
475
 
470
476
  ```js
471
- import { defineConfig } from '@lynx-js/rspeedy'
472
- import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
477
+ import { defineConfig } from "@lynx-js/rspeedy";
478
+ import { pluginCssMinimizer } from "@rsbuild/plugin-css-minimizer";
473
479
 
474
480
  export default defineConfig({
475
481
  plugins: [pluginCssMinimizer()],
476
- })
482
+ });
477
483
  ```
478
484
 
479
485
  - 525554c: **BREAKING CHANGE**: Bump ts-blank-space to ^0.6.0.
@@ -500,22 +506,22 @@
500
506
  - The new `type: 'reload-server'` will restart the development server when it detects changes in the specified files.
501
507
 
502
508
  ```js
503
- import { defineConfig } from '@lynx-js/rspeedy'
509
+ import { defineConfig } from "@lynx-js/rspeedy";
504
510
 
505
511
  export default defineConfig({
506
512
  dev: {
507
513
  watchFiles: [
508
514
  {
509
- type: 'reload-server',
510
- paths: ['public/**/*.txt'],
515
+ type: "reload-server",
516
+ paths: ["public/**/*.txt"],
511
517
  },
512
518
  {
513
- type: 'reload-page',
514
- paths: ['public/**/*.json'],
519
+ type: "reload-page",
520
+ paths: ["public/**/*.json"],
515
521
  },
516
522
  ],
517
523
  },
518
- })
524
+ });
519
525
  ```
520
526
 
521
527
  - be9b003: Add `source.exclude`.
package/dist/index.js CHANGED
@@ -472,8 +472,9 @@ async function loadConfig(loadConfigOptions) {
472
472
  let { configPath } = loadConfigOptions;
473
473
  if (!configPath || !(0, external_node_path_.isAbsolute)(configPath)) configPath = resolveConfigPath(loadConfigOptions.cwd ?? process.cwd(), configPath);
474
474
  const specifier = pathToFileURL(configPath).toString();
475
- const unregister = register({
476
- load: !shouldUseNativeImport(configPath),
475
+ let unregister;
476
+ unregister = shouldUseNativeImport(configPath) ? ()=>{} : register({
477
+ load: !hasNativeTSSupport(),
477
478
  resolve: true
478
479
  });
479
480
  try {
@@ -491,9 +492,10 @@ async function loadConfig(loadConfigOptions) {
491
492
  }
492
493
  }
493
494
  function shouldUseNativeImport(configPath) {
494
- return isJavaScriptPath(configPath) || hasNativeTSSupport();
495
+ return isJavaScriptPath(configPath) || isDeno();
495
496
  }
496
497
  function hasNativeTSSupport() {
498
+ if (isDeno()) return true;
497
499
  if (process.features.typescript) return true;
498
500
  if (false === process.features.typescript) return false;
499
501
  const { NODE_OPTIONS } = process.env;
@@ -508,6 +510,10 @@ function isJavaScriptPath(configPath) {
508
510
  '.cjs'
509
511
  ].includes(ext);
510
512
  }
513
+ function isDeno() {
514
+ if ('undefined' != typeof Deno || process.versions?.deno) return true;
515
+ return false;
516
+ }
511
517
  var version = __webpack_require__("./src/version.ts");
512
518
  var __webpack_exports__logger = core_.logger;
513
519
  var __webpack_exports__rsbuildVersion = version.Q0;
@@ -66,8 +66,9 @@ export const __webpack_modules__ = {
66
66
  let { configPath } = loadConfigOptions;
67
67
  if (!configPath || !(0, external_node_path_.isAbsolute)(configPath)) configPath = resolveConfigPath(loadConfigOptions.cwd ?? process.cwd(), configPath);
68
68
  const specifier = (0, external_node_url_.pathToFileURL)(configPath).toString();
69
- const unregister = (0, register_.register)({
70
- load: !shouldUseNativeImport(configPath),
69
+ let unregister;
70
+ unregister = shouldUseNativeImport(configPath) ? ()=>{} : (0, register_.register)({
71
+ load: !hasNativeTSSupport(),
71
72
  resolve: true
72
73
  });
73
74
  try {
@@ -85,9 +86,10 @@ export const __webpack_modules__ = {
85
86
  }
86
87
  }
87
88
  function shouldUseNativeImport(configPath) {
88
- return isJavaScriptPath(configPath) || hasNativeTSSupport();
89
+ return isJavaScriptPath(configPath) || isDeno();
89
90
  }
90
91
  function hasNativeTSSupport() {
92
+ if (isDeno()) return true;
91
93
  if (process.features.typescript) return true;
92
94
  if (false === process.features.typescript) return false;
93
95
  const { NODE_OPTIONS } = process.env;
@@ -102,6 +104,10 @@ export const __webpack_modules__ = {
102
104
  '.cjs'
103
105
  ].includes(ext);
104
106
  }
107
+ function isDeno() {
108
+ if ('undefined' != typeof Deno || process.versions?.deno) return true;
109
+ return false;
110
+ }
105
111
  async function init(cwd, options) {
106
112
  const { content: rspeedyConfig, configPath } = await loadConfig({
107
113
  cwd,
@@ -109,8 +109,9 @@ export const __webpack_modules__ = {
109
109
  let { configPath } = loadConfigOptions;
110
110
  if (!configPath || !(0, external_node_path_.isAbsolute)(configPath)) configPath = resolveConfigPath(loadConfigOptions.cwd ?? process.cwd(), configPath);
111
111
  const specifier = (0, external_node_url_.pathToFileURL)(configPath).toString();
112
- const unregister = (0, register_.register)({
113
- load: !shouldUseNativeImport(configPath),
112
+ let unregister;
113
+ unregister = shouldUseNativeImport(configPath) ? ()=>{} : (0, register_.register)({
114
+ load: !hasNativeTSSupport(),
114
115
  resolve: true
115
116
  });
116
117
  try {
@@ -128,9 +129,10 @@ export const __webpack_modules__ = {
128
129
  }
129
130
  }
130
131
  function shouldUseNativeImport(configPath) {
131
- return isJavaScriptPath(configPath) || hasNativeTSSupport();
132
+ return isJavaScriptPath(configPath) || isDeno();
132
133
  }
133
134
  function hasNativeTSSupport() {
135
+ if (isDeno()) return true;
134
136
  if (process.features.typescript) return true;
135
137
  if (false === process.features.typescript) return false;
136
138
  const { NODE_OPTIONS } = process.env;
@@ -145,6 +147,10 @@ export const __webpack_modules__ = {
145
147
  '.cjs'
146
148
  ].includes(ext);
147
149
  }
150
+ function isDeno() {
151
+ if ('undefined' != typeof Deno || process.versions?.deno) return true;
152
+ return false;
153
+ }
148
154
  async function init(cwd, options) {
149
155
  const { content: rspeedyConfig, configPath } = await loadConfig({
150
156
  cwd,
@@ -43,8 +43,9 @@ export const __webpack_modules__ = {
43
43
  let { configPath } = loadConfigOptions;
44
44
  if (!configPath || !(0, external_node_path_.isAbsolute)(configPath)) configPath = resolveConfigPath(loadConfigOptions.cwd ?? process.cwd(), configPath);
45
45
  const specifier = (0, external_node_url_.pathToFileURL)(configPath).toString();
46
- const unregister = (0, register_.register)({
47
- load: !shouldUseNativeImport(configPath),
46
+ let unregister;
47
+ unregister = shouldUseNativeImport(configPath) ? ()=>{} : (0, register_.register)({
48
+ load: !hasNativeTSSupport(),
48
49
  resolve: true
49
50
  });
50
51
  try {
@@ -62,9 +63,10 @@ export const __webpack_modules__ = {
62
63
  }
63
64
  }
64
65
  function shouldUseNativeImport(configPath) {
65
- return isJavaScriptPath(configPath) || hasNativeTSSupport();
66
+ return isJavaScriptPath(configPath) || isDeno();
66
67
  }
67
68
  function hasNativeTSSupport() {
69
+ if (isDeno()) return true;
68
70
  if (process.features.typescript) return true;
69
71
  if (false === process.features.typescript) return false;
70
72
  const { NODE_OPTIONS } = process.env;
@@ -79,6 +81,10 @@ export const __webpack_modules__ = {
79
81
  '.cjs'
80
82
  ].includes(ext);
81
83
  }
84
+ function isDeno() {
85
+ if ('undefined' != typeof Deno || process.versions?.deno) return true;
86
+ return false;
87
+ }
82
88
  async function init(cwd, options) {
83
89
  const { content: rspeedyConfig, configPath } = await loadConfig({
84
90
  cwd,
@@ -43,8 +43,9 @@ export const __webpack_modules__ = {
43
43
  let { configPath } = loadConfigOptions;
44
44
  if (!configPath || !(0, external_node_path_.isAbsolute)(configPath)) configPath = resolveConfigPath(loadConfigOptions.cwd ?? process.cwd(), configPath);
45
45
  const specifier = (0, external_node_url_.pathToFileURL)(configPath).toString();
46
- const unregister = (0, register_.register)({
47
- load: !shouldUseNativeImport(configPath),
46
+ let unregister;
47
+ unregister = shouldUseNativeImport(configPath) ? ()=>{} : (0, register_.register)({
48
+ load: !hasNativeTSSupport(),
48
49
  resolve: true
49
50
  });
50
51
  try {
@@ -62,9 +63,10 @@ export const __webpack_modules__ = {
62
63
  }
63
64
  }
64
65
  function shouldUseNativeImport(configPath) {
65
- return isJavaScriptPath(configPath) || hasNativeTSSupport();
66
+ return isJavaScriptPath(configPath) || isDeno();
66
67
  }
67
68
  function hasNativeTSSupport() {
69
+ if (isDeno()) return true;
68
70
  if (process.features.typescript) return true;
69
71
  if (false === process.features.typescript) return false;
70
72
  const { NODE_OPTIONS } = process.env;
@@ -79,6 +81,10 @@ export const __webpack_modules__ = {
79
81
  '.cjs'
80
82
  ].includes(ext);
81
83
  }
84
+ function isDeno() {
85
+ if ('undefined' != typeof Deno || process.versions?.deno) return true;
86
+ return false;
87
+ }
82
88
  async function init(cwd, options) {
83
89
  const { content: rspeedyConfig, configPath } = await loadConfig({
84
90
  cwd,