@workleap/rsbuild-configs 3.2.7 → 4.0.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.
- package/CHANGELOG.md +6 -0
- package/dist/build.js +0 -1
- package/dist/build.js.map +1 -1
- package/dist/dev.js +2 -5
- package/dist/dev.js.map +1 -1
- package/dist/index.js +1 -0
- package/package.json +18 -18
- package/src/build.ts +0 -1
- package/src/dev.ts +2 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @workleap/rsbuild-configs
|
|
2
2
|
|
|
3
|
+
## 4.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#425](https://github.com/workleap/wl-web-configs/pull/425) [`8de3e5a`](https://github.com/workleap/wl-web-configs/commit/8de3e5a26effe1f00cb905b4be5a24a961f50c5b) Thanks [@claude](https://github.com/apps/claude)! - Updated dependencies to their latest versions. Migrated `@workleap/rsbuild-configs` to `@rsbuild/core` 2.x, `@rspack/core` 2.x, and `@rsbuild/plugin-react` 2.x — `removeAvailableModules` was removed from the rspack `Optimization` type and `reactRefreshOptions.overlay` was removed from the react plugin (overlay is now controlled solely via `dev.client.overlay`).
|
|
8
|
+
|
|
3
9
|
## 3.2.7
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/build.js
CHANGED
package/dist/build.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sources":["../src/build.ts"],"sourcesContent":["import { defineConfig, type DistPathConfig, type HtmlConfig, type Minify, type RsbuildConfig, type RsbuildEntry, type RsbuildPlugins, type SourceMap } from \"@rsbuild/core\";\nimport { pluginImageCompress, type PluginImageCompressOptions } from \"@rsbuild/plugin-image-compress\";\nimport { pluginReact, type PluginReactOptions } from \"@rsbuild/plugin-react\";\nimport { pluginSvgr, type PluginSvgrOptions } from \"@rsbuild/plugin-svgr\";\nimport { SwcJsMinimizerRspackPlugin, type Optimization } from \"@rspack/core\";\nimport path from \"node:path\";\nimport { applyTransformers, type RsbuildConfigTransformer } from \"./applyTransformers.ts\";\n\nexport type OptimizeOption = boolean | \"readable\";\n\nexport type DefineBuildHtmlPluginConfigFunction = (defaultOptions: HtmlConfig) => HtmlConfig;\nexport type DefineBuildDefineReactPluginConfigFunction = (defaultOptions: PluginReactOptions) => PluginReactOptions;\nexport type DefineBuildSvgrPluginConfigFunction = (defaultOptions: PluginSvgrOptions) => PluginSvgrOptions;\nexport type DefineBuildImageCompressPluginConfigFunction = (defaultOptions: PluginImageCompressOptions) => PluginImageCompressOptions;\n\nexport interface DefineBuildConfigOptions {\n entry?: RsbuildEntry;\n // Similar to webpack.output.path.\n distPath?: DistPathConfig;\n // Similar to webpack.publicPath.\n assetPrefix?: string;\n plugins?: RsbuildPlugins;\n html?: false | DefineBuildHtmlPluginConfigFunction;\n minify?: Minify;\n optimize?: OptimizeOption;\n sourceMap?: boolean | SourceMap;\n react?: false | DefineBuildDefineReactPluginConfigFunction;\n svgr?: false | DefineBuildSvgrPluginConfigFunction;\n compressImage?: false | DefineBuildImageCompressPluginConfigFunction;\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\nfunction defineImageCompressPluginConfig(options: PluginImageCompressOptions) {\n return options;\n}\n\nexport function getOptimizationConfig(optimize: OptimizeOption): Optimization {\n if (optimize === true) {\n return {\n minimize: true\n };\n } else if (optimize === \"readable\") {\n return {\n minimize: true,\n minimizer: [\n new SwcJsMinimizerRspackPlugin({\n minimizerOptions: {\n mangle: false,\n compress: {\n toplevel: true,\n hoist_props: false\n }\n }\n })\n ],\n chunkIds: \"named\",\n moduleIds: \"named\",\n mangleExports: false\n };\n }\n\n // Doesn't turnoff everything but is good enough to help with debugging scenarios.\n return {\n minimize: false,\n chunkIds: \"named\",\n moduleIds: \"named\",\n concatenateModules: false,\n mangleExports: false,\n
|
|
1
|
+
{"version":3,"file":"build.js","sources":["../src/build.ts"],"sourcesContent":["import { defineConfig, type DistPathConfig, type HtmlConfig, type Minify, type RsbuildConfig, type RsbuildEntry, type RsbuildPlugins, type SourceMap } from \"@rsbuild/core\";\nimport { pluginImageCompress, type PluginImageCompressOptions } from \"@rsbuild/plugin-image-compress\";\nimport { pluginReact, type PluginReactOptions } from \"@rsbuild/plugin-react\";\nimport { pluginSvgr, type PluginSvgrOptions } from \"@rsbuild/plugin-svgr\";\nimport { SwcJsMinimizerRspackPlugin, type Optimization } from \"@rspack/core\";\nimport path from \"node:path\";\nimport { applyTransformers, type RsbuildConfigTransformer } from \"./applyTransformers.ts\";\n\nexport type OptimizeOption = boolean | \"readable\";\n\nexport type DefineBuildHtmlPluginConfigFunction = (defaultOptions: HtmlConfig) => HtmlConfig;\nexport type DefineBuildDefineReactPluginConfigFunction = (defaultOptions: PluginReactOptions) => PluginReactOptions;\nexport type DefineBuildSvgrPluginConfigFunction = (defaultOptions: PluginSvgrOptions) => PluginSvgrOptions;\nexport type DefineBuildImageCompressPluginConfigFunction = (defaultOptions: PluginImageCompressOptions) => PluginImageCompressOptions;\n\nexport interface DefineBuildConfigOptions {\n entry?: RsbuildEntry;\n // Similar to webpack.output.path.\n distPath?: DistPathConfig;\n // Similar to webpack.publicPath.\n assetPrefix?: string;\n plugins?: RsbuildPlugins;\n html?: false | DefineBuildHtmlPluginConfigFunction;\n minify?: Minify;\n optimize?: OptimizeOption;\n sourceMap?: boolean | SourceMap;\n react?: false | DefineBuildDefineReactPluginConfigFunction;\n svgr?: false | DefineBuildSvgrPluginConfigFunction;\n compressImage?: false | DefineBuildImageCompressPluginConfigFunction;\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\nfunction defineImageCompressPluginConfig(options: PluginImageCompressOptions) {\n return options;\n}\n\nexport function getOptimizationConfig(optimize: OptimizeOption): Optimization {\n if (optimize === true) {\n return {\n minimize: true\n };\n } else if (optimize === \"readable\") {\n return {\n minimize: true,\n minimizer: [\n new SwcJsMinimizerRspackPlugin({\n minimizerOptions: {\n mangle: false,\n compress: {\n toplevel: true,\n hoist_props: false\n }\n }\n })\n ],\n chunkIds: \"named\",\n moduleIds: \"named\",\n mangleExports: false\n };\n }\n\n // Doesn't turnoff everything but is good enough to help with debugging scenarios.\n return {\n minimize: false,\n chunkIds: \"named\",\n moduleIds: \"named\",\n concatenateModules: false,\n mangleExports: false,\n usedExports: false\n };\n}\n\nexport function defineBuildConfig(options: DefineBuildConfigOptions = {}) {\n const {\n entry = {\n index: path.resolve(\"./src/index.tsx\")\n },\n distPath = {\n root: path.resolve(\"./dist\")\n },\n assetPrefix = \"/\",\n plugins = [],\n html = defaultDefineHtmlPluginConfig,\n minify = true,\n optimize = true,\n sourceMap = {\n js: \"source-map\",\n css: true\n },\n react = defaultDefineReactPluginConfig,\n svgr = defineSvgrPluginConfig,\n compressImage = defineImageCompressPluginConfig,\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: \"production\",\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 distPath,\n cleanDistPath: true,\n assetPrefix,\n minify,\n sourceMap\n },\n html: html\n ? html({ template: path.resolve(\"./public/index.html\") })\n : undefined,\n plugins: [\n react && pluginReact(react({\n fastRefresh: false\n })),\n svgr && pluginSvgr(svgr({\n svgrOptions: {\n exportType: \"named\"\n }\n })),\n compressImage && pluginImageCompress(compressImage([\"jpeg\", \"png\", \"ico\", \"svg\"])),\n ...plugins\n ].filter(Boolean),\n tools: {\n rspack: {\n optimization: getOptimizationConfig(optimize),\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: \"build\",\n verbose\n });\n\n return defineConfig(transformedConfig);\n}\n"],"names":["defineConfig","pluginImageCompress","pluginReact","pluginSvgr","SwcJsMinimizerRspackPlugin","path","applyTransformers","defaultDefineHtmlPluginConfig","options","defaultDefineReactPluginConfig","defineSvgrPluginConfig","defineImageCompressPluginConfig","getOptimizationConfig","optimize","defineBuildConfig","entry","distPath","assetPrefix","plugins","html","minify","sourceMap","react","svgr","compressImage","environmentVariables","transformers","verbose","config","Object","acc","key","JSON","undefined","Boolean","transformedConfig"],"mappings":";;;;;;;;;;;;;;;AAA4K;AACtE;AACzB;AACH;AACG;AAChD;AAC6D;AA4B1F,SAASO,6BAA6BA,CAACC,OAAmB;IACtD,OAAOA;AACX;AAEA,SAASC,8BAA8BA,CAACD,OAA2B;IAC/D,OAAOA;AACX;AAEA,SAASE,sBAAsBA,CAACF,OAA0B;IACtD,OAAOA;AACX;AAEA,SAASG,+BAA+BA,CAACH,OAAmC;IACxE,OAAOA;AACX;AAEO,SAASI,qBAAqBA,CAACC,QAAwB;IAC1D,IAAIA,aAAa,MAAM;QACnB,OAAO;YACH,UAAU;QACd;IACJ,OAAO,IAAIA,aAAa,YAAY;QAChC,OAAO;YACH,UAAU;YACV,WAAW;gBACP,IAAIT,0BAA0BA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ACAC,QAAQpB,UAAUA,CAACoB,KAAK;gBACpB,aAAa;oBACT,YAAY;gBAChB;YACJ;YACAC,iBAAiBvB,mBAAmBA,CAACuB,cAAc;gBAAC;gBAAQ;gBAAO;gBAAO;aAAM;eAC7EN;SACN,CAAC,MAAM,CAACgB;QACT,OAAO;YACH,QAAQ;gBACJ,cAActB,qBAAqBA,CAACC;gBACpC,uBAAuBc,UAAU;oBAC7B,YAAY;oBACZ,OAAO;oBACP,OAAO;gBACX,IAAIM;YACR;QACJ;IACJ;IAEA,MAAME,oBAAoB7B,iBAAiBA,CAACsB,QAAQF,cAAc;QAC9D,aAAa;QACbC;IACJ;IAEA,OAAO3B,YAAYA,CAACmC;AACxB"}
|
package/dist/dev.js
CHANGED
|
@@ -44,7 +44,7 @@ function defineDevConfig(options = {}) {
|
|
|
44
44
|
assetPrefix,
|
|
45
45
|
lazyCompilation,
|
|
46
46
|
hmr: hmr || fastRefresh,
|
|
47
|
-
client: overlay === false
|
|
47
|
+
client: overlay === false ? {
|
|
48
48
|
overlay: false
|
|
49
49
|
} : undefined,
|
|
50
50
|
writeToDisk
|
|
@@ -78,10 +78,7 @@ function defineDevConfig(options = {}) {
|
|
|
78
78
|
plugins: [
|
|
79
79
|
https && (isBoolean(https) || isFunction(https)) && pluginBasicSsl(isFunction(https) ? https({}) : undefined),
|
|
80
80
|
react && pluginReact(react({
|
|
81
|
-
fastRefresh
|
|
82
|
-
reactRefreshOptions: {
|
|
83
|
-
overlay: overlay !== false
|
|
84
|
-
}
|
|
81
|
+
fastRefresh
|
|
85
82
|
})),
|
|
86
83
|
svgr && pluginSvgr(svgr({
|
|
87
84
|
svgrOptions: {
|
package/dist/dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.js","sources":["../src/dev.ts"],"sourcesContent":["import { defineConfig, type HtmlConfig, type RsbuildConfig, type RsbuildEntry, type RsbuildPlugins, type ServerConfig, type SourceMap } from \"@rsbuild/core\";\nimport { pluginBasicSsl, type PluginBasicSslOptions } 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, isFunction } from \"./assertions.ts\";\n\nexport type DefineDevHtmlPluginConfigFunction = (defaultOptions: HtmlConfig) => HtmlConfig;\nexport type DefineDevDefineReactPluginConfigFunction = (defaultOptions: PluginReactOptions) => PluginReactOptions;\nexport type DefineDevSvgrPluginConfigFunction = (defaultOptions: PluginSvgrOptions) => PluginSvgrOptions;\nexport type DefineBasicSslConfigFunction = (defaultOptions: PluginBasicSslOptions) => PluginBasicSslOptions;\n\nexport interface DefineDevConfigOptions {\n entry?: RsbuildEntry;\n https?: boolean | DefineBasicSslConfigFunction | 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,\n lazyCompilation,\n hmr: hmr || fastRefresh,\n client:
|
|
1
|
+
{"version":3,"file":"dev.js","sources":["../src/dev.ts"],"sourcesContent":["import { defineConfig, type HtmlConfig, type RsbuildConfig, type RsbuildEntry, type RsbuildPlugins, type ServerConfig, type SourceMap } from \"@rsbuild/core\";\nimport { pluginBasicSsl, type PluginBasicSslOptions } 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, isFunction } from \"./assertions.ts\";\n\nexport type DefineDevHtmlPluginConfigFunction = (defaultOptions: HtmlConfig) => HtmlConfig;\nexport type DefineDevDefineReactPluginConfigFunction = (defaultOptions: PluginReactOptions) => PluginReactOptions;\nexport type DefineDevSvgrPluginConfigFunction = (defaultOptions: PluginSvgrOptions) => PluginSvgrOptions;\nexport type DefineBasicSslConfigFunction = (defaultOptions: PluginBasicSslOptions) => PluginBasicSslOptions;\n\nexport interface DefineDevConfigOptions {\n entry?: RsbuildEntry;\n https?: boolean | DefineBasicSslConfigFunction | 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,\n lazyCompilation,\n hmr: hmr || fastRefresh,\n client: overlay === false ? {\n overlay: false\n } : undefined,\n writeToDisk\n },\n server: {\n https: isBoolean(https) || isFunction(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 https && (isBoolean(https) || isFunction(https)) && pluginBasicSsl(isFunction(https) ? https({}) : undefined),\n react && pluginReact(react({\n fastRefresh\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","isFunction","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;AACtE;AACV;AACH;AAC7C;AAC6D;AAClC;AA6BxD,SAASQ,6BAA6BA,CAACC,OAAmB;IACtD,OAAOA;AACX;AAEA,SAASC,8BAA8BA,CAACD,OAA2B;IAC/D,OAAOA;AACX;AAEA,SAASE,sBAAsBA,CAACF,OAA0B;IACtD,OAAOA;AACX;AAEO,SAASG,eAAeA,CAACH,UAAkC,CAAC,CAAC;IAChE,MAAM,EACFI,QAAQ;QACJ,OAAOT,iBAAY,CAAC;IACxB,CAAC,EACDU,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,s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IAEA,OAAO9B,YAAYA,CAACsC;AACxB"}
|
package/dist/index.js
CHANGED
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": "
|
|
5
|
+
"version": "4.0.0",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -28,30 +28,30 @@
|
|
|
28
28
|
"CHANGELOG.md"
|
|
29
29
|
],
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@rsbuild/core": "^
|
|
32
|
-
"@rspack/core": "^
|
|
31
|
+
"@rsbuild/core": "^2.0.5",
|
|
32
|
+
"@rspack/core": "^2.0.3"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@rsbuild/plugin-basic-ssl": "^1.2.2",
|
|
36
|
-
"@rsbuild/plugin-image-compress": "^1.3.
|
|
37
|
-
"@rsbuild/plugin-react": "^
|
|
38
|
-
"@rsbuild/plugin-svgr": "^
|
|
36
|
+
"@rsbuild/plugin-image-compress": "^1.3.3",
|
|
37
|
+
"@rsbuild/plugin-react": "^2.0.0",
|
|
38
|
+
"@rsbuild/plugin-svgr": "^2.0.2"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@eslint/js": "9.39.2",
|
|
42
|
-
"@rsbuild/core": "
|
|
43
|
-
"@rslib/core": "0.
|
|
44
|
-
"@rspack/core": "
|
|
45
|
-
"@types/node": "25.
|
|
46
|
-
"@typescript-eslint/parser": "8.
|
|
47
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
42
|
+
"@rsbuild/core": "2.0.5",
|
|
43
|
+
"@rslib/core": "0.21.4",
|
|
44
|
+
"@rspack/core": "2.0.3",
|
|
45
|
+
"@types/node": "25.7.0",
|
|
46
|
+
"@typescript-eslint/parser": "8.59.3",
|
|
47
|
+
"@typescript/native-preview": "7.0.0-dev.20260512.1",
|
|
48
48
|
"eslint": "9.39.2",
|
|
49
|
-
"typescript": "6.0.
|
|
50
|
-
"typescript-eslint": "8.
|
|
51
|
-
"vitest": "4.1.
|
|
52
|
-
"@workleap/eslint-configs": "2.0.
|
|
53
|
-
"@workleap/rslib-configs": "1.
|
|
54
|
-
"@workleap/typescript-configs": "4.0.
|
|
49
|
+
"typescript": "6.0.3",
|
|
50
|
+
"typescript-eslint": "8.59.3",
|
|
51
|
+
"vitest": "4.1.6",
|
|
52
|
+
"@workleap/eslint-configs": "2.0.3",
|
|
53
|
+
"@workleap/rslib-configs": "1.2.0",
|
|
54
|
+
"@workleap/typescript-configs": "4.0.1"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"build": "rslib build -c rslib.config.ts",
|
package/src/build.ts
CHANGED
package/src/dev.ts
CHANGED
|
@@ -80,7 +80,7 @@ export function defineDevConfig(options: DefineDevConfigOptions = {}) {
|
|
|
80
80
|
assetPrefix,
|
|
81
81
|
lazyCompilation,
|
|
82
82
|
hmr: hmr || fastRefresh,
|
|
83
|
-
client:
|
|
83
|
+
client: overlay === false ? {
|
|
84
84
|
overlay: false
|
|
85
85
|
} : undefined,
|
|
86
86
|
writeToDisk
|
|
@@ -115,10 +115,7 @@ export function defineDevConfig(options: DefineDevConfigOptions = {}) {
|
|
|
115
115
|
plugins: [
|
|
116
116
|
https && (isBoolean(https) || isFunction(https)) && pluginBasicSsl(isFunction(https) ? https({}) : undefined),
|
|
117
117
|
react && pluginReact(react({
|
|
118
|
-
fastRefresh
|
|
119
|
-
reactRefreshOptions: {
|
|
120
|
-
overlay: overlay !== false
|
|
121
|
-
}
|
|
118
|
+
fastRefresh
|
|
122
119
|
})),
|
|
123
120
|
svgr && pluginSvgr(svgr({
|
|
124
121
|
svgrOptions: {
|