@workleap/rsbuild-configs 3.1.0 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/dev.js +1 -1
- package/dist/dev.js.map +1 -1
- package/dist/storybook.d.ts +1 -0
- package/dist/storybook.js +4 -1
- package/dist/storybook.js.map +1 -1
- package/package.json +4 -4
- package/src/dev.ts +1 -1
- package/src/storybook.ts +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @workleap/rsbuild-configs
|
|
2
2
|
|
|
3
|
+
## 3.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#295](https://github.com/workleap/wl-web-configs/pull/295) [`0751463`](https://github.com/workleap/wl-web-configs/commit/075146304e97eeeb0866032e2c467e5c65823b27) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Latest version of rsbuild set "lazyCompilation" to true by default which breaks Storybook dev server. This version force "lazyCompilation" to false by default.
|
|
8
|
+
|
|
3
9
|
## 3.1.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/dist/dev.js
CHANGED
|
@@ -40,7 +40,7 @@ function defineSvgrPluginConfig(options) {
|
|
|
40
40
|
function defineDevConfig(options = {}) {
|
|
41
41
|
const { entry = {
|
|
42
42
|
index: node_path.resolve("./src/index.tsx")
|
|
43
|
-
}, https = false, host = "localhost", port = 8080, assetPrefix = "/", plugins = [], html = defaultDefineHtmlPluginConfig, lazyCompilation =
|
|
43
|
+
}, https = false, host = "localhost", port = 8080, assetPrefix = "/", plugins = [], html = defaultDefineHtmlPluginConfig, lazyCompilation = false, hmr = true, fastRefresh = true, sourceMap = {
|
|
44
44
|
js: "cheap-module-source-map",
|
|
45
45
|
css: true
|
|
46
46
|
}, overlay, writeToDisk, react = defaultDefineReactPluginConfig, svgr = defineSvgrPluginConfig, // Using an empty object literal as the default value to ensure
|
package/dist/dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.js","sources":["webpack://@workleap/rsbuild-configs/./src/dev.ts"],"sourcesContent":["import { defineConfig, type HtmlConfig, type RsbuildConfig, type RsbuildEntry, type RsbuildPlugins, type ServerConfig, type SourceMap } from \"@rsbuild/core\";\nimport { pluginBasicSsl } from \"@rsbuild/plugin-basic-ssl\";\nimport { pluginReact, type PluginReactOptions } from \"@rsbuild/plugin-react\";\nimport { pluginSvgr, type PluginSvgrOptions } from \"@rsbuild/plugin-svgr\";\nimport path from \"node:path\";\nimport { applyTransformers, type RsbuildConfigTransformer } from \"./applyTransformers.ts\";\nimport { isBoolean } from \"./assertions.ts\";\n\nexport type DefineDevHtmlPluginConfigFunction = (defaultOptions: HtmlConfig) => HtmlConfig;\nexport type DefineDevDefineReactPluginConfigFunction = (defaultOptions: PluginReactOptions) => PluginReactOptions;\nexport type DefineDevSvgrPluginConfigFunction = (defaultOptions: PluginSvgrOptions) => PluginSvgrOptions;\n\nexport interface DefineDevConfigOptions {\n entry?: RsbuildEntry;\n https?: boolean | ServerConfig[\"https\"];\n host?: string;\n port?: number;\n // Similar to webpack.publicPath.\n assetPrefix?: string;\n plugins?: RsbuildPlugins;\n html?: false | DefineDevHtmlPluginConfigFunction;\n lazyCompilation?: boolean;\n hmr?: boolean;\n fastRefresh?: boolean;\n sourceMap?: false | SourceMap;\n overlay?: false;\n writeToDisk?: true;\n react?: false | DefineDevDefineReactPluginConfigFunction;\n svgr? : false | DefineDevSvgrPluginConfigFunction;\n environmentVariables?: Record<string, unknown>;\n transformers?: RsbuildConfigTransformer[];\n verbose?: boolean;\n}\n\nfunction defaultDefineHtmlPluginConfig(options: HtmlConfig) {\n return options;\n}\n\nfunction defaultDefineReactPluginConfig(options: PluginReactOptions) {\n return options;\n}\n\nfunction defineSvgrPluginConfig(options: PluginSvgrOptions) {\n return options;\n}\n\nexport function defineDevConfig(options: DefineDevConfigOptions = {}) {\n const {\n entry = {\n index: path.resolve(\"./src/index.tsx\")\n },\n https = false,\n host = \"localhost\",\n port = 8080,\n assetPrefix = \"/\",\n plugins = [],\n html = defaultDefineHtmlPluginConfig,\n lazyCompilation =
|
|
1
|
+
{"version":3,"file":"dev.js","sources":["webpack://@workleap/rsbuild-configs/./src/dev.ts"],"sourcesContent":["import { defineConfig, type HtmlConfig, type RsbuildConfig, type RsbuildEntry, type RsbuildPlugins, type ServerConfig, type SourceMap } from \"@rsbuild/core\";\nimport { pluginBasicSsl } from \"@rsbuild/plugin-basic-ssl\";\nimport { pluginReact, type PluginReactOptions } from \"@rsbuild/plugin-react\";\nimport { pluginSvgr, type PluginSvgrOptions } from \"@rsbuild/plugin-svgr\";\nimport path from \"node:path\";\nimport { applyTransformers, type RsbuildConfigTransformer } from \"./applyTransformers.ts\";\nimport { isBoolean } from \"./assertions.ts\";\n\nexport type DefineDevHtmlPluginConfigFunction = (defaultOptions: HtmlConfig) => HtmlConfig;\nexport type DefineDevDefineReactPluginConfigFunction = (defaultOptions: PluginReactOptions) => PluginReactOptions;\nexport type DefineDevSvgrPluginConfigFunction = (defaultOptions: PluginSvgrOptions) => PluginSvgrOptions;\n\nexport interface DefineDevConfigOptions {\n entry?: RsbuildEntry;\n https?: boolean | ServerConfig[\"https\"];\n host?: string;\n port?: number;\n // Similar to webpack.publicPath.\n assetPrefix?: string;\n plugins?: RsbuildPlugins;\n html?: false | DefineDevHtmlPluginConfigFunction;\n lazyCompilation?: boolean;\n hmr?: boolean;\n fastRefresh?: boolean;\n sourceMap?: false | SourceMap;\n overlay?: false;\n writeToDisk?: true;\n react?: false | DefineDevDefineReactPluginConfigFunction;\n svgr? : false | DefineDevSvgrPluginConfigFunction;\n environmentVariables?: Record<string, unknown>;\n transformers?: RsbuildConfigTransformer[];\n verbose?: boolean;\n}\n\nfunction defaultDefineHtmlPluginConfig(options: HtmlConfig) {\n return options;\n}\n\nfunction defaultDefineReactPluginConfig(options: PluginReactOptions) {\n return options;\n}\n\nfunction defineSvgrPluginConfig(options: PluginSvgrOptions) {\n return options;\n}\n\nexport function defineDevConfig(options: DefineDevConfigOptions = {}) {\n const {\n entry = {\n index: path.resolve(\"./src/index.tsx\")\n },\n https = false,\n host = \"localhost\",\n port = 8080,\n assetPrefix = \"/\",\n plugins = [],\n html = defaultDefineHtmlPluginConfig,\n lazyCompilation = false,\n hmr = true,\n fastRefresh = true,\n sourceMap = {\n js: \"cheap-module-source-map\",\n css: true\n },\n overlay,\n writeToDisk,\n react = defaultDefineReactPluginConfig,\n svgr = defineSvgrPluginConfig,\n // Using an empty object literal as the default value to ensure\n // \"process.env\" is always available.\n environmentVariables = {},\n transformers = [],\n verbose = false\n } = options;\n\n const config: RsbuildConfig = {\n mode: \"development\",\n dev: {\n // assetPrefix: assetPrefix ?? `${https ? \"https\" : \"http\"}://${host}:${port}`,\n assetPrefix,\n lazyCompilation,\n hmr: hmr || fastRefresh,\n client: (overlay === false || fastRefresh) ? {\n overlay: false\n } : undefined,\n writeToDisk\n },\n server: {\n https: isBoolean(https) ? undefined : https,\n host,\n port,\n historyApiFallback: true\n },\n source: {\n entry,\n // Stringify the environment variables because the plugin does a direct text replacement. Otherwise, \"production\" would become production\n // after replacement and cause an undefined var error because the production var doesn't exist.\n // For more information, view: https://rsbuild.dev/guide/advanced/env-vars#using-define.\n define: {\n \"process.env\": Object.keys(environmentVariables).reduce((acc, key) => {\n acc[key] = JSON.stringify(environmentVariables[key]);\n\n return acc;\n }, {} as Record<string, string>)\n }\n },\n output: {\n target: \"web\",\n minify: false,\n sourceMap\n },\n html: html\n ? html({ template: path.resolve(\"./public/index.html\") })\n : undefined,\n plugins: [\n isBoolean(https) && https && pluginBasicSsl(),\n react && pluginReact(react({\n fastRefresh,\n reactRefreshOptions: {\n overlay: overlay !== false\n }\n })),\n svgr && pluginSvgr(svgr({\n svgrOptions: {\n exportType: \"named\"\n }\n })),\n ...plugins\n ].filter(Boolean),\n tools: {\n rspack: {\n infrastructureLogging: verbose ? {\n appendOnly: true,\n level: \"verbose\",\n debug: /PackFileCache/\n } : undefined\n }\n }\n };\n\n const transformedConfig = applyTransformers(config, transformers, {\n environment: \"dev\",\n verbose\n });\n\n return defineConfig(transformedConfig);\n}\n\n"],"names":["defineConfig","pluginBasicSsl","pluginReact","pluginSvgr","path","applyTransformers","isBoolean","defaultDefineHtmlPluginConfig","options","defaultDefineReactPluginConfig","defineSvgrPluginConfig","defineDevConfig","entry","https","host","port","assetPrefix","plugins","html","lazyCompilation","hmr","fastRefresh","sourceMap","overlay","writeToDisk","react","svgr","environmentVariables","transformers","verbose","config","undefined","Object","acc","key","JSON","Boolean","transformedConfig"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAA6J;AAClG;AACkB;AACH;AAC7C;AAC6D;AAC9C;AA4B5C,SAASO,8BAA8BC,OAAmB;IACtD,OAAOA;AACX;AAEA,SAASC,+BAA+BD,OAA2B;IAC/D,OAAOA;AACX;AAEA,SAASE,uBAAuBF,OAA0B;IACtD,OAAOA;AACX;AAEO,SAASG,gBAAgBH,UAAkC,CAAC,CAAC;IAChE,MAAM,EACFI,QAAQ;QACJ,OAAOR,iBAAY,CAAC;IACxB,CAAC,EACDS,QAAQ,KAAK,EACbC,OAAO,WAAW,EAClBC,OAAO,IAAI,EACXC,cAAc,GAAG,EACjBC,UAAU,EAAE,EACZC,OAAOX,6BAA6B,EACpCY,kBAAkB,KAAK,EACvBC,MAAM,IAAI,EACVC,cAAc,IAAI,EAClBC,YAAY;QACR,IAAI;QACJ,KAAK;IACT,CAAC,EACDC,OAAO,EACPC,WAAW,EACXC,QAAQhB,8BAA8B,EACtCiB,OAAOhB,sBAAsB,EAC7B,+DAA+D;IAC/D,qCAAqC;IACrCiB,uBAAuB,CAAC,CAAC,EACzBC,eAAe,EAAE,EACjBC,UAAU,KAAK,EAClB,GAAGrB;IAEJ,MAAMsB,SAAwB;QAC1B,MAAM;QACN,KAAK;YACD,+EAA+E;YAC/Ed;YACAG;YACA,KAAKC,OAAOC;YACZ,QAASE,YAAY,SAASF,cAAe;gBACzC,SAAS;YACb,IAAIU;YACJP;QACJ;QACA,QAAQ;YACJ,OAAOlB,SAASA,CAACO,SAASkB,YAAYlB;YACtCC;YACAC;YACA,oBAAoB;QACxB;QACA,QAAQ;YACJH;YACA,yIAAyI;YACzI,+FAA+F;YAC/F,wFAAwF;YACxF,QAAQ;gBACJ,eAAeoB,OAAO,IAAI,CAACL,sBAAsB,MAAM,CAAC,CAACM,KAAKC;oBAC1DD,GAAG,CAACC,IAAI,GAAGC,KAAK,SAAS,CAACR,oBAAoB,CAACO,IAAI;oBAEnD,OAAOD;gBACX,GAAG,CAAC;YACR;QACJ;QACA,QAAQ;YACJ,QAAQ;YACR,QAAQ;YACRX;QACJ;QACA,MAAMJ,OACAA,KAAK;YAAE,UAAUd,iBAAY,CAAC;QAAuB,KACrD2B;QACN,SAAS;YACLzB,SAASA,CAACO,UAAUA,SAASZ,cAAcA;YAC3CwB,SAASvB,WAAWA,CAACuB,MAAM;gBACvBJ;gBACA,qBAAqB;oBACjB,SAASE,YAAY;gBACzB;YACJ;YACAG,QAAQvB,UAAUA,CAACuB,KAAK;gBACpB,aAAa;oBACT,YAAY;gBAChB;YACJ;eACGT;SACN,CAAC,MAAM,CAACmB;QACT,OAAO;YACH,QAAQ;gBACJ,uBAAuBP,UAAU;oBAC7B,YAAY;oBACZ,OAAO;oBACP,OAAO;gBACX,IAAIE;YACR;QACJ;IACJ;IAEA,MAAMM,oBAAoBhC,iBAAiBA,CAACyB,QAAQF,cAAc;QAC9D,aAAa;QACbC;IACJ;IAEA,OAAO7B,YAAYA,CAACqC;AACxB"}
|
package/dist/storybook.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export type DefineStorybookDefineReactPluginConfigFunction = (defaultOptions: Pl
|
|
|
6
6
|
export type DefineStorybookSvgrPluginConfigFunction = (defaultOptions: PluginSvgrOptions) => PluginSvgrOptions;
|
|
7
7
|
export interface DefineStorybookConfigOptions {
|
|
8
8
|
plugins?: RsbuildPlugins;
|
|
9
|
+
lazyCompilation?: boolean;
|
|
9
10
|
sourceMap?: boolean | SourceMap;
|
|
10
11
|
react?: false | DefineStorybookDefineReactPluginConfigFunction;
|
|
11
12
|
svgr?: false | DefineStorybookSvgrPluginConfigFunction;
|
package/dist/storybook.js
CHANGED
|
@@ -23,13 +23,16 @@ function defineSvgrPluginConfig(options) {
|
|
|
23
23
|
return options;
|
|
24
24
|
}
|
|
25
25
|
function defineStorybookConfig(options = {}) {
|
|
26
|
-
const { plugins = [], sourceMap = {
|
|
26
|
+
const { plugins = [], lazyCompilation = false, sourceMap = {
|
|
27
27
|
js: "cheap-module-source-map",
|
|
28
28
|
css: true
|
|
29
29
|
}, react = defaultDefineReactPluginConfig, svgr = defineSvgrPluginConfig, // Using an empty object literal as the default value to ensure
|
|
30
30
|
// "process.env" is always available.
|
|
31
31
|
environmentVariables = {}, transformers = [], verbose = false } = options;
|
|
32
32
|
const config = {
|
|
33
|
+
dev: {
|
|
34
|
+
lazyCompilation
|
|
35
|
+
},
|
|
33
36
|
source: {
|
|
34
37
|
// Stringify the environment variables because the plugin does a direct text replacement. Otherwise, "production" would become production
|
|
35
38
|
// after replacement and cause an undefined var error because the production var doesn't exist.
|
package/dist/storybook.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storybook.js","sources":["webpack://@workleap/rsbuild-configs/./src/storybook.ts"],"sourcesContent":["import { defineConfig, type RsbuildConfig, type RsbuildPlugins, type SourceMap } from \"@rsbuild/core\";\nimport { pluginReact, type PluginReactOptions } from \"@rsbuild/plugin-react\";\nimport { pluginSvgr, type PluginSvgrOptions } from \"@rsbuild/plugin-svgr\";\nimport { applyTransformers, type RsbuildConfigTransformer } from \"./applyTransformers.ts\";\n\nexport type DefineStorybookDefineReactPluginConfigFunction = (defaultOptions: PluginReactOptions) => PluginReactOptions;\nexport type DefineStorybookSvgrPluginConfigFunction = (defaultOptions: PluginSvgrOptions) => PluginSvgrOptions;\n\nexport interface DefineStorybookConfigOptions {\n plugins?: RsbuildPlugins;\n sourceMap?: boolean | SourceMap;\n react?: false | DefineStorybookDefineReactPluginConfigFunction;\n svgr? : false | DefineStorybookSvgrPluginConfigFunction;\n environmentVariables?: Record<string, unknown>;\n transformers?: RsbuildConfigTransformer[];\n verbose?: boolean;\n}\n\nfunction defaultDefineReactPluginConfig(options: PluginReactOptions) {\n return options;\n}\n\nfunction defineSvgrPluginConfig(options: PluginSvgrOptions) {\n return options;\n}\n\nexport function defineStorybookConfig(options: DefineStorybookConfigOptions = {}) {\n const {\n plugins = [],\n sourceMap = {\n js: \"cheap-module-source-map\",\n css: true\n },\n react = defaultDefineReactPluginConfig,\n svgr = defineSvgrPluginConfig,\n // Using an empty object literal as the default value to ensure\n // \"process.env\" is always available.\n environmentVariables = {},\n transformers = [],\n verbose = false\n } = options;\n\n const config: RsbuildConfig = {\n source: {\n // Stringify the environment variables because the plugin does a direct text replacement. Otherwise, \"production\" would become production\n // after replacement and cause an undefined var error because the production var doesn't exist.\n // For more information, view: https://rsbuild.dev/guide/advanced/env-vars#using-define.\n define: {\n \"process.env\": Object.keys(environmentVariables).reduce((acc, key) => {\n acc[key] = JSON.stringify(environmentVariables[key]);\n\n return acc;\n }, {} as Record<string, string>)\n }\n },\n output: {\n target: \"web\",\n minify: false,\n sourceMap\n },\n plugins: [\n react && pluginReact(react({})),\n svgr && pluginSvgr(svgr({\n svgrOptions: {\n exportType: \"named\"\n }\n })),\n ...plugins\n ].filter(Boolean),\n tools: {\n rspack: {\n infrastructureLogging: verbose ? {\n appendOnly: true,\n level: \"verbose\",\n debug: /PackFileCache/\n } : undefined\n }\n }\n };\n\n const transformedConfig = applyTransformers(config, transformers, {\n environment: \"storybook\",\n verbose\n });\n\n return defineConfig(transformedConfig);\n}\n"],"names":["defineConfig","pluginReact","pluginSvgr","applyTransformers","defaultDefineReactPluginConfig","options","defineSvgrPluginConfig","defineStorybookConfig","plugins","sourceMap","react","svgr","environmentVariables","transformers","verbose","config","Object","acc","key","JSON","Boolean","undefined","transformedConfig"],"mappings":";;;;;;;;;;;;;;AAAsG;AACzB;AACH;AACgB;
|
|
1
|
+
{"version":3,"file":"storybook.js","sources":["webpack://@workleap/rsbuild-configs/./src/storybook.ts"],"sourcesContent":["import { defineConfig, type RsbuildConfig, type RsbuildPlugins, type SourceMap } from \"@rsbuild/core\";\nimport { pluginReact, type PluginReactOptions } from \"@rsbuild/plugin-react\";\nimport { pluginSvgr, type PluginSvgrOptions } from \"@rsbuild/plugin-svgr\";\nimport { applyTransformers, type RsbuildConfigTransformer } from \"./applyTransformers.ts\";\n\nexport type DefineStorybookDefineReactPluginConfigFunction = (defaultOptions: PluginReactOptions) => PluginReactOptions;\nexport type DefineStorybookSvgrPluginConfigFunction = (defaultOptions: PluginSvgrOptions) => PluginSvgrOptions;\n\nexport interface DefineStorybookConfigOptions {\n plugins?: RsbuildPlugins;\n lazyCompilation?: boolean;\n sourceMap?: boolean | SourceMap;\n react?: false | DefineStorybookDefineReactPluginConfigFunction;\n svgr? : false | DefineStorybookSvgrPluginConfigFunction;\n environmentVariables?: Record<string, unknown>;\n transformers?: RsbuildConfigTransformer[];\n verbose?: boolean;\n}\n\nfunction defaultDefineReactPluginConfig(options: PluginReactOptions) {\n return options;\n}\n\nfunction defineSvgrPluginConfig(options: PluginSvgrOptions) {\n return options;\n}\n\nexport function defineStorybookConfig(options: DefineStorybookConfigOptions = {}) {\n const {\n plugins = [],\n lazyCompilation = false,\n sourceMap = {\n js: \"cheap-module-source-map\",\n css: true\n },\n react = defaultDefineReactPluginConfig,\n svgr = defineSvgrPluginConfig,\n // Using an empty object literal as the default value to ensure\n // \"process.env\" is always available.\n environmentVariables = {},\n transformers = [],\n verbose = false\n } = options;\n\n const config: RsbuildConfig = {\n dev: {\n lazyCompilation\n },\n source: {\n // Stringify the environment variables because the plugin does a direct text replacement. Otherwise, \"production\" would become production\n // after replacement and cause an undefined var error because the production var doesn't exist.\n // For more information, view: https://rsbuild.dev/guide/advanced/env-vars#using-define.\n define: {\n \"process.env\": Object.keys(environmentVariables).reduce((acc, key) => {\n acc[key] = JSON.stringify(environmentVariables[key]);\n\n return acc;\n }, {} as Record<string, string>)\n }\n },\n output: {\n target: \"web\",\n minify: false,\n sourceMap\n },\n plugins: [\n react && pluginReact(react({})),\n svgr && pluginSvgr(svgr({\n svgrOptions: {\n exportType: \"named\"\n }\n })),\n ...plugins\n ].filter(Boolean),\n tools: {\n rspack: {\n infrastructureLogging: verbose ? {\n appendOnly: true,\n level: \"verbose\",\n debug: /PackFileCache/\n } : undefined\n }\n }\n };\n\n const transformedConfig = applyTransformers(config, transformers, {\n environment: \"storybook\",\n verbose\n });\n\n return defineConfig(transformedConfig);\n}\n"],"names":["defineConfig","pluginReact","pluginSvgr","applyTransformers","defaultDefineReactPluginConfig","options","defineSvgrPluginConfig","defineStorybookConfig","plugins","lazyCompilation","sourceMap","react","svgr","environmentVariables","transformers","verbose","config","Object","acc","key","JSON","Boolean","undefined","transformedConfig"],"mappings":";;;;;;;;;;;;;;AAAsG;AACzB;AACH;AACgB;AAgB1F,SAASI,+BAA+BC,OAA2B;IAC/D,OAAOA;AACX;AAEA,SAASC,uBAAuBD,OAA0B;IACtD,OAAOA;AACX;AAEO,SAASE,sBAAsBF,UAAwC,CAAC,CAAC;IAC5E,MAAM,EACFG,UAAU,EAAE,EACZC,kBAAkB,KAAK,EACvBC,YAAY;QACR,IAAI;QACJ,KAAK;IACT,CAAC,EACDC,QAAQP,8BAA8B,EACtCQ,OAAON,sBAAsB,EAC7B,+DAA+D;IAC/D,qCAAqC;IACrCO,uBAAuB,CAAC,CAAC,EACzBC,eAAe,EAAE,EACjBC,UAAU,KAAK,EAClB,GAAGV;IAEJ,MAAMW,SAAwB;QAC1B,KAAK;YACDP;QACJ;QACA,QAAQ;YACJ,yIAAyI;YACzI,+FAA+F;YAC/F,wFAAwF;YACxF,QAAQ;gBACJ,eAAeQ,OAAO,IAAI,CAACJ,sBAAsB,MAAM,CAAC,CAACK,KAAKC;oBAC1DD,GAAG,CAACC,IAAI,GAAGC,KAAK,SAAS,CAACP,oBAAoB,CAACM,IAAI;oBAEnD,OAAOD;gBACX,GAAG,CAAC;YACR;QACJ;QACA,QAAQ;YACJ,QAAQ;YACR,QAAQ;YACRR;QACJ;QACA,SAAS;YACLC,SAASV,WAAWA,CAACU,MAAM,CAAC;YAC5BC,QAAQV,UAAUA,CAACU,KAAK;gBACpB,aAAa;oBACT,YAAY;gBAChB;YACJ;eACGJ;SACN,CAAC,MAAM,CAACa;QACT,OAAO;YACH,QAAQ;gBACJ,uBAAuBN,UAAU;oBAC7B,YAAY;oBACZ,OAAO;oBACP,OAAO;gBACX,IAAIO;YACR;QACJ;IACJ;IAEA,MAAMC,oBAAoBpB,iBAAiBA,CAACa,QAAQF,cAAc;QAC9D,aAAa;QACbC;IACJ;IAEA,OAAOf,YAAYA,CAACuB;AACxB"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@workleap/rsbuild-configs",
|
|
3
3
|
"author": "Workleap",
|
|
4
4
|
"description": "Workleap recommended Rsbuild configurations.",
|
|
5
|
-
"version": "3.1.
|
|
5
|
+
"version": "3.1.1",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"@rslib/core": "0.10.6",
|
|
43
43
|
"@rspack/core": "1.4.8",
|
|
44
44
|
"@types/node": "24.0.14",
|
|
45
|
-
"@typescript-eslint/parser": "
|
|
45
|
+
"@typescript-eslint/parser": "7.18.0",
|
|
46
46
|
"eslint": "8.57.0",
|
|
47
47
|
"typescript": "5.8.3",
|
|
48
48
|
"vitest": "3.1.4",
|
|
49
49
|
"@workleap/eslint-plugin": "3.5.0",
|
|
50
|
-
"@workleap/
|
|
51
|
-
"@workleap/
|
|
50
|
+
"@workleap/typescript-configs": "3.0.4",
|
|
51
|
+
"@workleap/rslib-configs": "1.1.0"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"build": "rslib build -c rslib.config.ts",
|
package/src/dev.ts
CHANGED
|
@@ -55,7 +55,7 @@ export function defineDevConfig(options: DefineDevConfigOptions = {}) {
|
|
|
55
55
|
assetPrefix = "/",
|
|
56
56
|
plugins = [],
|
|
57
57
|
html = defaultDefineHtmlPluginConfig,
|
|
58
|
-
lazyCompilation =
|
|
58
|
+
lazyCompilation = false,
|
|
59
59
|
hmr = true,
|
|
60
60
|
fastRefresh = true,
|
|
61
61
|
sourceMap = {
|
package/src/storybook.ts
CHANGED
|
@@ -8,6 +8,7 @@ export type DefineStorybookSvgrPluginConfigFunction = (defaultOptions: PluginSvg
|
|
|
8
8
|
|
|
9
9
|
export interface DefineStorybookConfigOptions {
|
|
10
10
|
plugins?: RsbuildPlugins;
|
|
11
|
+
lazyCompilation?: boolean;
|
|
11
12
|
sourceMap?: boolean | SourceMap;
|
|
12
13
|
react?: false | DefineStorybookDefineReactPluginConfigFunction;
|
|
13
14
|
svgr? : false | DefineStorybookSvgrPluginConfigFunction;
|
|
@@ -27,6 +28,7 @@ function defineSvgrPluginConfig(options: PluginSvgrOptions) {
|
|
|
27
28
|
export function defineStorybookConfig(options: DefineStorybookConfigOptions = {}) {
|
|
28
29
|
const {
|
|
29
30
|
plugins = [],
|
|
31
|
+
lazyCompilation = false,
|
|
30
32
|
sourceMap = {
|
|
31
33
|
js: "cheap-module-source-map",
|
|
32
34
|
css: true
|
|
@@ -41,6 +43,9 @@ export function defineStorybookConfig(options: DefineStorybookConfigOptions = {}
|
|
|
41
43
|
} = options;
|
|
42
44
|
|
|
43
45
|
const config: RsbuildConfig = {
|
|
46
|
+
dev: {
|
|
47
|
+
lazyCompilation
|
|
48
|
+
},
|
|
44
49
|
source: {
|
|
45
50
|
// Stringify the environment variables because the plugin does a direct text replacement. Otherwise, "production" would become production
|
|
46
51
|
// after replacement and cause an undefined var error because the production var doesn't exist.
|