@lynx-js/rspeedy-canary 0.11.3 → 0.11.4-canary-20250922-209878c2

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/dist/index.d.ts CHANGED
@@ -15,6 +15,7 @@
15
15
  * ```
16
16
  */
17
17
 
18
+ import type { CompressOptions } from '@rsbuild/core';
18
19
  import type { CreateRsbuildOptions } from '@rsbuild/core';
19
20
  import type { DataUriLimit } from '@rsbuild/core';
20
21
  import type { DistPathConfig } from '@rsbuild/core';
@@ -2724,6 +2725,59 @@ export declare interface Server {
2724
2725
  * ```
2725
2726
  */
2726
2727
  base?: string | undefined;
2728
+ /**
2729
+ * Configure whether to enable {@link https://developer.mozilla.org/en-US/docs/Glossary/gzip_compression | gzip compression } for static assets served by the dev server or preview server.
2730
+ *
2731
+ * Default: true
2732
+ *
2733
+ * See {@link https://rsbuild.rs/config/server/compress | Rsbuild - server.compress } for details.
2734
+ *
2735
+ * @example
2736
+ *
2737
+ * To disable the gzip compression, set compress to false:
2738
+ *
2739
+ * ```js
2740
+ * export default {
2741
+ * server: {
2742
+ * compress: false,
2743
+ * },
2744
+ * }
2745
+ * ```
2746
+ *
2747
+ * @example
2748
+ *
2749
+ * Compress if it starts with /foo
2750
+ *
2751
+ * ```js
2752
+ * export default {
2753
+ * server: {
2754
+ * compress: {
2755
+ * filter: (req) => {
2756
+ * if (req.url?.includes('/foo')) {
2757
+ * return false;
2758
+ * }
2759
+ * return true;
2760
+ * },
2761
+ * },
2762
+ * },
2763
+ * }
2764
+ * ```
2765
+ *
2766
+ * @example
2767
+ *
2768
+ * set level of zlib compression
2769
+ *
2770
+ * ```js
2771
+ * export default {
2772
+ * server: {
2773
+ * compress: {
2774
+ * level: 6,
2775
+ * },
2776
+ * },
2777
+ * }
2778
+ * ```
2779
+ */
2780
+ compress?: boolean | CompressOptions | undefined;
2727
2781
  /**
2728
2782
  * Adds headers to all responses.
2729
2783
  *
package/dist/index.js CHANGED
@@ -364,6 +364,7 @@ function toRsbuildConfig(config) {
364
364
  },
365
365
  server: {
366
366
  base: config.server?.base,
367
+ compress: config.server?.compress,
367
368
  headers: config.server?.headers,
368
369
  host: config.server?.host,
369
370
  port: config.server?.port,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/rspeedy-canary",
3
- "version": "0.11.3",
3
+ "version": "0.11.4-canary-20250922-209878c2",
4
4
  "description": "A webpack/rspack-based frontend toolchain for Lynx",
5
5
  "keywords": [
6
6
  "webpack",