@workleap/rslib-configs 1.0.6 → 1.1.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 +10 -10
- package/dist/build.js.map +1 -1
- package/dist/dev.js +10 -10
- package/dist/dev.js.map +1 -1
- package/dist/storybook.js +9 -9
- package/dist/storybook.js.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @workleap/rslib-configs
|
|
2
2
|
|
|
3
|
+
## 1.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#290](https://github.com/workleap/wl-web-configs/pull/290) [`8f0a5a0`](https://github.com/workleap/wl-web-configs/commit/8f0a5a03f8c1a55f22c41b1850d7d20a036b259d) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Updated dependencies.
|
|
8
|
+
|
|
3
9
|
## 1.0.6
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/build.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { pluginReact } from "@rsbuild/plugin-react";
|
|
2
|
+
import { pluginSvgr } from "@rsbuild/plugin-svgr";
|
|
3
|
+
import { defineConfig } from "@rslib/core";
|
|
4
|
+
import { applyTransformers } from "./applyTransformers.js";
|
|
5
|
+
import { isFunction } from "./assertions.js";
|
|
6
6
|
|
|
7
7
|
;// CONCATENATED MODULE: external "@rsbuild/plugin-react"
|
|
8
8
|
|
|
@@ -44,7 +44,7 @@ function defineBuildConfig(options = {}) {
|
|
|
44
44
|
exportType: "named"
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
|
-
const config =
|
|
47
|
+
const config = defineConfig({
|
|
48
48
|
mode: "production",
|
|
49
49
|
lib: [
|
|
50
50
|
{
|
|
@@ -66,15 +66,15 @@ function defineBuildConfig(options = {}) {
|
|
|
66
66
|
sourceMap
|
|
67
67
|
},
|
|
68
68
|
plugins: [
|
|
69
|
-
react &&
|
|
70
|
-
svgr &&
|
|
69
|
+
react && pluginReact(isFunction(react) ? react({}) : {}),
|
|
70
|
+
svgr && pluginSvgr(isFunction(svgr) ? svgr(svgrDefaultOptions) : svgrDefaultOptions),
|
|
71
71
|
...plugins
|
|
72
72
|
].filter(Boolean)
|
|
73
73
|
});
|
|
74
|
-
const transformedConfig =
|
|
74
|
+
const transformedConfig = applyTransformers(config, transformers, {
|
|
75
75
|
environment: "build"
|
|
76
76
|
});
|
|
77
|
-
return
|
|
77
|
+
return defineConfig(transformedConfig);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
export { defineBuildConfig };
|
package/dist/build.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sources":["webpack://@workleap/rslib-configs/./src/build.ts"],"sourcesContent":["import type { DistPathConfig, RsbuildPlugins, SourceMap } from \"@rsbuild/core\";\nimport { pluginReact, type PluginReactOptions } from \"@rsbuild/plugin-react\";\nimport { pluginSvgr, type PluginSvgrOptions } from \"@rsbuild/plugin-svgr\";\nimport { defineConfig, type Dts, type RsbuildConfigEntry, type RsbuildConfigOutputTarget, type Syntax } from \"@rslib/core\";\nimport { applyTransformers, type RslibConfigTransformer } from \"./applyTransformers.ts\";\nimport { isFunction } from \"./assertions.ts\";\n\nexport type DefineBuildDefineReactPluginConfigFunction = (defaultOptions: PluginReactOptions) => PluginReactOptions;\nexport type DefineBuildSvgrPluginConfigFunction = (defaultOptions: PluginSvgrOptions) => PluginSvgrOptions;\n\nexport interface DefineBuildConfigOptions {\n entry?: RsbuildConfigEntry;\n syntax?: Syntax;\n bundle?: boolean;\n tsconfigPath?: string;\n dts?: Dts;\n target?: RsbuildConfigOutputTarget;\n distPath?: DistPathConfig;\n plugins?: RsbuildPlugins;\n sourceMap?: boolean | SourceMap;\n react?: true | DefineBuildDefineReactPluginConfigFunction;\n svgr? : true | DefineBuildSvgrPluginConfigFunction;\n transformers?: RslibConfigTransformer[];\n}\n\nexport function defineBuildConfig(options: DefineBuildConfigOptions = {}) {\n const {\n entry: entryValue,\n syntax = \"esnext\",\n bundle = false,\n tsconfigPath,\n dts = true,\n target = \"web\",\n distPath = {\n root: \"./dist\"\n },\n plugins = [],\n sourceMap = {\n js: \"source-map\",\n css: true\n },\n react = false,\n svgr = false,\n transformers = []\n } = options;\n\n if (!bundle && !tsconfigPath) {\n throw new Error(\"[rslib-configs] When the \\\"bundle\\\" option is \\\"false\\\", a \\\"tsconfigPath\\\" option must be provided. We recommend including a tsconfig.build.json file specifically for compiling the library project.\");\n }\n\n let entry = entryValue;\n\n if (!entry) {\n entry = {\n index: bundle ? [\"./src/index.ts\", \"./src/index.js\"] : \"./src/**\"\n };\n }\n\n const svgrDefaultOptions: PluginSvgrOptions = {\n svgrOptions: {\n exportType: \"named\"\n }\n };\n\n const config = defineConfig({\n mode: \"production\",\n lib: [{\n format: \"esm\",\n syntax,\n bundle,\n dts\n }],\n source: {\n entry,\n tsconfigPath\n },\n output: {\n target,\n distPath,\n cleanDistPath: true,\n minify: false,\n sourceMap\n },\n plugins: ([\n react && pluginReact(isFunction(react) ? react({}) : {}),\n svgr && pluginSvgr(isFunction(svgr) ? svgr(svgrDefaultOptions) : svgrDefaultOptions),\n ...plugins\n ] as RsbuildPlugins).filter(Boolean)\n });\n\n const transformedConfig = applyTransformers(config, transformers, {\n environment: \"build\"\n });\n\n return defineConfig(transformedConfig);\n}\n"],"names":["pluginReact","pluginSvgr","defineConfig","applyTransformers","isFunction","defineBuildConfig","options","entryValue","syntax","bundle","tsconfigPath","dts","target","distPath","plugins","sourceMap","react","svgr","transformers","Error","entry","svgrDefaultOptions","config","Boolean","transformedConfig"],"mappings":";;;;;;;;;;;;;;;;;AAC6E;AACH;AACiD;AACnC;AAC3C;AAoBtC,SAASK,kBAAkBC,UAAoC,CAAC,CAAC;IACpE,MAAM,EACF,OAAOC,UAAU,EACjBC,SAAS,QAAQ,EACjBC,SAAS,KAAK,EACdC,YAAY,EACZC,MAAM,IAAI,EACVC,SAAS,KAAK,EACdC,WAAW;QACP,MAAM;IACV,CAAC,EACDC,UAAU,EAAE,EACZC,YAAY;QACR,IAAI;QACJ,KAAK;IACT,CAAC,EACDC,QAAQ,KAAK,EACbC,OAAO,KAAK,EACZC,eAAe,EAAE,EACpB,GAAGZ;IAEJ,IAAI,CAACG,UAAU,CAACC,cAAc;QAC1B,MAAM,IAAIS,MAAM;IACpB;IAEA,IAAIC,QAAQb;IAEZ,IAAI,CAACa,OAAO;QACRA,QAAQ;YACJ,OAAOX,SAAS;gBAAC;gBAAkB;aAAiB,GAAG;QAC3D;IACJ;IAEA,MAAMY,qBAAwC;QAC1C,aAAa;YACT,YAAY;QAChB;IACJ;IAEA,MAAMC,SAASpB,
|
|
1
|
+
{"version":3,"file":"build.js","sources":["webpack://@workleap/rslib-configs/./src/build.ts"],"sourcesContent":["import type { DistPathConfig, RsbuildPlugins, SourceMap } from \"@rsbuild/core\";\nimport { pluginReact, type PluginReactOptions } from \"@rsbuild/plugin-react\";\nimport { pluginSvgr, type PluginSvgrOptions } from \"@rsbuild/plugin-svgr\";\nimport { defineConfig, type Dts, type RsbuildConfigEntry, type RsbuildConfigOutputTarget, type Syntax } from \"@rslib/core\";\nimport { applyTransformers, type RslibConfigTransformer } from \"./applyTransformers.ts\";\nimport { isFunction } from \"./assertions.ts\";\n\nexport type DefineBuildDefineReactPluginConfigFunction = (defaultOptions: PluginReactOptions) => PluginReactOptions;\nexport type DefineBuildSvgrPluginConfigFunction = (defaultOptions: PluginSvgrOptions) => PluginSvgrOptions;\n\nexport interface DefineBuildConfigOptions {\n entry?: RsbuildConfigEntry;\n syntax?: Syntax;\n bundle?: boolean;\n tsconfigPath?: string;\n dts?: Dts;\n target?: RsbuildConfigOutputTarget;\n distPath?: DistPathConfig;\n plugins?: RsbuildPlugins;\n sourceMap?: boolean | SourceMap;\n react?: true | DefineBuildDefineReactPluginConfigFunction;\n svgr? : true | DefineBuildSvgrPluginConfigFunction;\n transformers?: RslibConfigTransformer[];\n}\n\nexport function defineBuildConfig(options: DefineBuildConfigOptions = {}) {\n const {\n entry: entryValue,\n syntax = \"esnext\",\n bundle = false,\n tsconfigPath,\n dts = true,\n target = \"web\",\n distPath = {\n root: \"./dist\"\n },\n plugins = [],\n sourceMap = {\n js: \"source-map\",\n css: true\n },\n react = false,\n svgr = false,\n transformers = []\n } = options;\n\n if (!bundle && !tsconfigPath) {\n throw new Error(\"[rslib-configs] When the \\\"bundle\\\" option is \\\"false\\\", a \\\"tsconfigPath\\\" option must be provided. We recommend including a tsconfig.build.json file specifically for compiling the library project.\");\n }\n\n let entry = entryValue;\n\n if (!entry) {\n entry = {\n index: bundle ? [\"./src/index.ts\", \"./src/index.js\"] : \"./src/**\"\n };\n }\n\n const svgrDefaultOptions: PluginSvgrOptions = {\n svgrOptions: {\n exportType: \"named\"\n }\n };\n\n const config = defineConfig({\n mode: \"production\",\n lib: [{\n format: \"esm\",\n syntax,\n bundle,\n dts\n }],\n source: {\n entry,\n tsconfigPath\n },\n output: {\n target,\n distPath,\n cleanDistPath: true,\n minify: false,\n sourceMap\n },\n plugins: ([\n react && pluginReact(isFunction(react) ? react({}) : {}),\n svgr && pluginSvgr(isFunction(svgr) ? svgr(svgrDefaultOptions) : svgrDefaultOptions),\n ...plugins\n ] as RsbuildPlugins).filter(Boolean)\n });\n\n const transformedConfig = applyTransformers(config, transformers, {\n environment: \"build\"\n });\n\n return defineConfig(transformedConfig);\n}\n"],"names":["pluginReact","pluginSvgr","defineConfig","applyTransformers","isFunction","defineBuildConfig","options","entryValue","syntax","bundle","tsconfigPath","dts","target","distPath","plugins","sourceMap","react","svgr","transformers","Error","entry","svgrDefaultOptions","config","Boolean","transformedConfig"],"mappings":";;;;;;;;;;;;;;;;;AAC6E;AACH;AACiD;AACnC;AAC3C;AAoBtC,SAASK,kBAAkBC,UAAoC,CAAC,CAAC;IACpE,MAAM,EACF,OAAOC,UAAU,EACjBC,SAAS,QAAQ,EACjBC,SAAS,KAAK,EACdC,YAAY,EACZC,MAAM,IAAI,EACVC,SAAS,KAAK,EACdC,WAAW;QACP,MAAM;IACV,CAAC,EACDC,UAAU,EAAE,EACZC,YAAY;QACR,IAAI;QACJ,KAAK;IACT,CAAC,EACDC,QAAQ,KAAK,EACbC,OAAO,KAAK,EACZC,eAAe,EAAE,EACpB,GAAGZ;IAEJ,IAAI,CAACG,UAAU,CAACC,cAAc;QAC1B,MAAM,IAAIS,MAAM;IACpB;IAEA,IAAIC,QAAQb;IAEZ,IAAI,CAACa,OAAO;QACRA,QAAQ;YACJ,OAAOX,SAAS;gBAAC;gBAAkB;aAAiB,GAAG;QAC3D;IACJ;IAEA,MAAMY,qBAAwC;QAC1C,aAAa;YACT,YAAY;QAChB;IACJ;IAEA,MAAMC,SAASpB,YAAYA,CAAC;QACxB,MAAM;QACN,KAAK;YAAC;gBACF,QAAQ;gBACRM;gBACAC;gBACAE;YACJ;SAAE;QACF,QAAQ;YACJS;YACAV;QACJ;QACA,QAAQ;YACJE;YACAC;YACA,eAAe;YACf,QAAQ;YACRE;QACJ;QACA,SAAU;YACNC,SAAShB,WAAWA,CAACI,UAAUA,CAACY,SAASA,MAAM,CAAC,KAAK,CAAC;YACtDC,QAAQhB,UAAUA,CAACG,UAAUA,CAACa,QAAQA,KAAKI,sBAAsBA;eAC9DP;SACN,CAAoB,MAAM,CAACS;IAChC;IAEA,MAAMC,oBAAoBrB,iBAAiBA,CAACmB,QAAQJ,cAAc;QAC9D,aAAa;IACjB;IAEA,OAAOhB,YAAYA,CAACsB;AACxB"}
|
package/dist/dev.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { pluginReact } from "@rsbuild/plugin-react";
|
|
2
|
+
import { pluginSvgr } from "@rsbuild/plugin-svgr";
|
|
3
|
+
import { defineConfig } from "@rslib/core";
|
|
4
|
+
import { applyTransformers } from "./applyTransformers.js";
|
|
5
|
+
import { isFunction } from "./assertions.js";
|
|
6
6
|
|
|
7
7
|
;// CONCATENATED MODULE: external "@rsbuild/plugin-react"
|
|
8
8
|
|
|
@@ -44,7 +44,7 @@ function defineDevConfig(options = {}) {
|
|
|
44
44
|
exportType: "named"
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
|
-
const config =
|
|
47
|
+
const config = defineConfig({
|
|
48
48
|
mode: "development",
|
|
49
49
|
lib: [
|
|
50
50
|
{
|
|
@@ -66,15 +66,15 @@ function defineDevConfig(options = {}) {
|
|
|
66
66
|
sourceMap
|
|
67
67
|
},
|
|
68
68
|
plugins: [
|
|
69
|
-
react &&
|
|
70
|
-
svgr &&
|
|
69
|
+
react && pluginReact(isFunction(react) ? react({}) : {}),
|
|
70
|
+
svgr && pluginSvgr(isFunction(svgr) ? svgr(svgrDefaultOptions) : svgrDefaultOptions),
|
|
71
71
|
...plugins
|
|
72
72
|
].filter(Boolean)
|
|
73
73
|
});
|
|
74
|
-
const transformedConfig =
|
|
74
|
+
const transformedConfig = applyTransformers(config, transformers, {
|
|
75
75
|
environment: "dev"
|
|
76
76
|
});
|
|
77
|
-
return
|
|
77
|
+
return defineConfig(transformedConfig);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
export { defineDevConfig };
|
package/dist/dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.js","sources":["webpack://@workleap/rslib-configs/./src/dev.ts"],"sourcesContent":["import type { DistPathConfig, RsbuildPlugins, SourceMap } from \"@rsbuild/core\";\nimport { pluginReact, type PluginReactOptions } from \"@rsbuild/plugin-react\";\nimport { pluginSvgr, type PluginSvgrOptions } from \"@rsbuild/plugin-svgr\";\nimport { defineConfig, type Dts, type RsbuildConfigEntry, type RsbuildConfigOutputTarget, type Syntax } from \"@rslib/core\";\nimport { applyTransformers, type RslibConfigTransformer } from \"./applyTransformers.ts\";\nimport { isFunction } from \"./assertions.ts\";\n\nexport type DefineDevDefineReactPluginConfigFunction = (defaultOptions: PluginReactOptions) => PluginReactOptions;\nexport type DefineDevSvgrPluginConfigFunction = (defaultOptions: PluginSvgrOptions) => PluginSvgrOptions;\n\nexport interface DefineDevConfigOptions {\n entry?: RsbuildConfigEntry;\n syntax?: Syntax;\n bundle?: boolean;\n tsconfigPath?: string;\n dts?: Dts;\n target?: RsbuildConfigOutputTarget;\n distPath?: DistPathConfig;\n plugins?: RsbuildPlugins;\n sourceMap?: boolean | SourceMap;\n react?: true | DefineDevDefineReactPluginConfigFunction;\n svgr? : true | DefineDevSvgrPluginConfigFunction;\n transformers?: RslibConfigTransformer[];\n}\n\nexport function defineDevConfig(options: DefineDevConfigOptions = {}) {\n const {\n entry: entryValue,\n syntax = \"esnext\",\n bundle = false,\n tsconfigPath,\n dts = false,\n target = \"web\",\n distPath = {\n root: \"./dist\"\n },\n plugins = [],\n sourceMap = {\n js: \"cheap-module-source-map\",\n css: true\n },\n react = false,\n svgr = false,\n transformers = []\n } = options;\n\n if (!bundle && !tsconfigPath) {\n throw new Error(\"[rslib-configs] When the \\\"bundle\\\" option is \\\"false\\\", a \\\"tsconfigPath\\\" option must be provided. We recommend including a tsconfig.build.json file specifically for compiling the library project.\");\n }\n\n let entry = entryValue;\n\n if (!entry) {\n entry = {\n index: bundle ? [\"./src/index.ts\", \"./src/index.js\"] : \"./src/**\"\n };\n }\n\n const svgrDefaultOptions: PluginSvgrOptions = {\n svgrOptions: {\n exportType: \"named\"\n }\n };\n\n const config = defineConfig({\n mode: \"development\",\n lib: [{\n format: \"esm\",\n syntax,\n bundle,\n dts\n }],\n source: {\n entry,\n tsconfigPath\n },\n output: {\n target,\n distPath,\n cleanDistPath: true,\n minify: false,\n sourceMap\n },\n plugins: ([\n react && pluginReact(isFunction(react) ? react({}) : {}),\n svgr && pluginSvgr(isFunction(svgr) ? svgr(svgrDefaultOptions) : svgrDefaultOptions),\n ...plugins\n ] as RsbuildPlugins).filter(Boolean)\n });\n\n const transformedConfig = applyTransformers(config, transformers, {\n environment: \"dev\"\n });\n\n return defineConfig(transformedConfig);\n}\n"],"names":["pluginReact","pluginSvgr","defineConfig","applyTransformers","isFunction","defineDevConfig","options","entryValue","syntax","bundle","tsconfigPath","dts","target","distPath","plugins","sourceMap","react","svgr","transformers","Error","entry","svgrDefaultOptions","config","Boolean","transformedConfig"],"mappings":";;;;;;;;;;;;;;;;;AAC6E;AACH;AACiD;AACnC;AAC3C;AAoBtC,SAASK,gBAAgBC,UAAkC,CAAC,CAAC;IAChE,MAAM,EACF,OAAOC,UAAU,EACjBC,SAAS,QAAQ,EACjBC,SAAS,KAAK,EACdC,YAAY,EACZC,MAAM,KAAK,EACXC,SAAS,KAAK,EACdC,WAAW;QACP,MAAM;IACV,CAAC,EACDC,UAAU,EAAE,EACZC,YAAY;QACR,IAAI;QACJ,KAAK;IACT,CAAC,EACDC,QAAQ,KAAK,EACbC,OAAO,KAAK,EACZC,eAAe,EAAE,EACpB,GAAGZ;IAEJ,IAAI,CAACG,UAAU,CAACC,cAAc;QAC1B,MAAM,IAAIS,MAAM;IACpB;IAEA,IAAIC,QAAQb;IAEZ,IAAI,CAACa,OAAO;QACRA,QAAQ;YACJ,OAAOX,SAAS;gBAAC;gBAAkB;aAAiB,GAAG;QAC3D;IACJ;IAEA,MAAMY,qBAAwC;QAC1C,aAAa;YACT,YAAY;QAChB;IACJ;IAEA,MAAMC,SAASpB,
|
|
1
|
+
{"version":3,"file":"dev.js","sources":["webpack://@workleap/rslib-configs/./src/dev.ts"],"sourcesContent":["import type { DistPathConfig, RsbuildPlugins, SourceMap } from \"@rsbuild/core\";\nimport { pluginReact, type PluginReactOptions } from \"@rsbuild/plugin-react\";\nimport { pluginSvgr, type PluginSvgrOptions } from \"@rsbuild/plugin-svgr\";\nimport { defineConfig, type Dts, type RsbuildConfigEntry, type RsbuildConfigOutputTarget, type Syntax } from \"@rslib/core\";\nimport { applyTransformers, type RslibConfigTransformer } from \"./applyTransformers.ts\";\nimport { isFunction } from \"./assertions.ts\";\n\nexport type DefineDevDefineReactPluginConfigFunction = (defaultOptions: PluginReactOptions) => PluginReactOptions;\nexport type DefineDevSvgrPluginConfigFunction = (defaultOptions: PluginSvgrOptions) => PluginSvgrOptions;\n\nexport interface DefineDevConfigOptions {\n entry?: RsbuildConfigEntry;\n syntax?: Syntax;\n bundle?: boolean;\n tsconfigPath?: string;\n dts?: Dts;\n target?: RsbuildConfigOutputTarget;\n distPath?: DistPathConfig;\n plugins?: RsbuildPlugins;\n sourceMap?: boolean | SourceMap;\n react?: true | DefineDevDefineReactPluginConfigFunction;\n svgr? : true | DefineDevSvgrPluginConfigFunction;\n transformers?: RslibConfigTransformer[];\n}\n\nexport function defineDevConfig(options: DefineDevConfigOptions = {}) {\n const {\n entry: entryValue,\n syntax = \"esnext\",\n bundle = false,\n tsconfigPath,\n dts = false,\n target = \"web\",\n distPath = {\n root: \"./dist\"\n },\n plugins = [],\n sourceMap = {\n js: \"cheap-module-source-map\",\n css: true\n },\n react = false,\n svgr = false,\n transformers = []\n } = options;\n\n if (!bundle && !tsconfigPath) {\n throw new Error(\"[rslib-configs] When the \\\"bundle\\\" option is \\\"false\\\", a \\\"tsconfigPath\\\" option must be provided. We recommend including a tsconfig.build.json file specifically for compiling the library project.\");\n }\n\n let entry = entryValue;\n\n if (!entry) {\n entry = {\n index: bundle ? [\"./src/index.ts\", \"./src/index.js\"] : \"./src/**\"\n };\n }\n\n const svgrDefaultOptions: PluginSvgrOptions = {\n svgrOptions: {\n exportType: \"named\"\n }\n };\n\n const config = defineConfig({\n mode: \"development\",\n lib: [{\n format: \"esm\",\n syntax,\n bundle,\n dts\n }],\n source: {\n entry,\n tsconfigPath\n },\n output: {\n target,\n distPath,\n cleanDistPath: true,\n minify: false,\n sourceMap\n },\n plugins: ([\n react && pluginReact(isFunction(react) ? react({}) : {}),\n svgr && pluginSvgr(isFunction(svgr) ? svgr(svgrDefaultOptions) : svgrDefaultOptions),\n ...plugins\n ] as RsbuildPlugins).filter(Boolean)\n });\n\n const transformedConfig = applyTransformers(config, transformers, {\n environment: \"dev\"\n });\n\n return defineConfig(transformedConfig);\n}\n"],"names":["pluginReact","pluginSvgr","defineConfig","applyTransformers","isFunction","defineDevConfig","options","entryValue","syntax","bundle","tsconfigPath","dts","target","distPath","plugins","sourceMap","react","svgr","transformers","Error","entry","svgrDefaultOptions","config","Boolean","transformedConfig"],"mappings":";;;;;;;;;;;;;;;;;AAC6E;AACH;AACiD;AACnC;AAC3C;AAoBtC,SAASK,gBAAgBC,UAAkC,CAAC,CAAC;IAChE,MAAM,EACF,OAAOC,UAAU,EACjBC,SAAS,QAAQ,EACjBC,SAAS,KAAK,EACdC,YAAY,EACZC,MAAM,KAAK,EACXC,SAAS,KAAK,EACdC,WAAW;QACP,MAAM;IACV,CAAC,EACDC,UAAU,EAAE,EACZC,YAAY;QACR,IAAI;QACJ,KAAK;IACT,CAAC,EACDC,QAAQ,KAAK,EACbC,OAAO,KAAK,EACZC,eAAe,EAAE,EACpB,GAAGZ;IAEJ,IAAI,CAACG,UAAU,CAACC,cAAc;QAC1B,MAAM,IAAIS,MAAM;IACpB;IAEA,IAAIC,QAAQb;IAEZ,IAAI,CAACa,OAAO;QACRA,QAAQ;YACJ,OAAOX,SAAS;gBAAC;gBAAkB;aAAiB,GAAG;QAC3D;IACJ;IAEA,MAAMY,qBAAwC;QAC1C,aAAa;YACT,YAAY;QAChB;IACJ;IAEA,MAAMC,SAASpB,YAAYA,CAAC;QACxB,MAAM;QACN,KAAK;YAAC;gBACF,QAAQ;gBACRM;gBACAC;gBACAE;YACJ;SAAE;QACF,QAAQ;YACJS;YACAV;QACJ;QACA,QAAQ;YACJE;YACAC;YACA,eAAe;YACf,QAAQ;YACRE;QACJ;QACA,SAAU;YACNC,SAAShB,WAAWA,CAACI,UAAUA,CAACY,SAASA,MAAM,CAAC,KAAK,CAAC;YACtDC,QAAQhB,UAAUA,CAACG,UAAUA,CAACa,QAAQA,KAAKI,sBAAsBA;eAC9DP;SACN,CAAoB,MAAM,CAACS;IAChC;IAEA,MAAMC,oBAAoBrB,iBAAiBA,CAACmB,QAAQJ,cAAc;QAC9D,aAAa;IACjB;IAEA,OAAOhB,YAAYA,CAACsB;AACxB"}
|
package/dist/storybook.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { pluginReact } from "@rsbuild/plugin-react";
|
|
2
|
+
import { pluginSvgr } from "@rsbuild/plugin-svgr";
|
|
3
|
+
import { defineConfig } from "@rslib/core";
|
|
4
|
+
import { applyTransformers } from "./applyTransformers.js";
|
|
5
5
|
|
|
6
6
|
;// CONCATENATED MODULE: external "@rsbuild/plugin-react"
|
|
7
7
|
|
|
@@ -27,7 +27,7 @@ function defineStorybookConfig(options = {}) {
|
|
|
27
27
|
js: "cheap-module-source-map",
|
|
28
28
|
css: true
|
|
29
29
|
}, react = defaultDefineReactPluginConfig, svgr = defineSvgrPluginConfig, transformers = [] } = options;
|
|
30
|
-
const config =
|
|
30
|
+
const config = defineConfig({
|
|
31
31
|
lib: [
|
|
32
32
|
{
|
|
33
33
|
dts: false
|
|
@@ -41,8 +41,8 @@ function defineStorybookConfig(options = {}) {
|
|
|
41
41
|
sourceMap
|
|
42
42
|
},
|
|
43
43
|
plugins: [
|
|
44
|
-
react &&
|
|
45
|
-
svgr &&
|
|
44
|
+
react && pluginReact(react({})),
|
|
45
|
+
svgr && pluginSvgr(svgr({
|
|
46
46
|
svgrOptions: {
|
|
47
47
|
exportType: "named"
|
|
48
48
|
}
|
|
@@ -50,10 +50,10 @@ function defineStorybookConfig(options = {}) {
|
|
|
50
50
|
...plugins
|
|
51
51
|
]
|
|
52
52
|
});
|
|
53
|
-
const transformedConfig =
|
|
53
|
+
const transformedConfig = applyTransformers(config, transformers, {
|
|
54
54
|
environment: "storybook"
|
|
55
55
|
});
|
|
56
|
-
return
|
|
56
|
+
return defineConfig(transformedConfig);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
export { defineStorybookConfig };
|
package/dist/storybook.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storybook.js","sources":["webpack://@workleap/rslib-configs/./src/storybook.ts"],"sourcesContent":["import type { RsbuildPlugins, SourceMap } from \"@rsbuild/core\";\nimport { pluginReact, type PluginReactOptions } from \"@rsbuild/plugin-react\";\nimport { pluginSvgr, type PluginSvgrOptions } from \"@rsbuild/plugin-svgr\";\nimport { defineConfig } from \"@rslib/core\";\nimport { applyTransformers, type RslibConfigTransformer } 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 transformers?: RslibConfigTransformer[];\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 transformers = []\n } = options;\n\n const config = defineConfig({\n lib: [{\n dts: false\n }],\n output: {\n target: \"web\",\n // Setting the clean option to true breaks the Storybook integration.\n cleanDistPath: false,\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 ]\n });\n\n const transformedConfig = applyTransformers(config, transformers, {\n environment: \"storybook\"\n });\n\n return defineConfig(transformedConfig);\n}\n"],"names":["pluginReact","pluginSvgr","defineConfig","applyTransformers","defaultDefineReactPluginConfig","options","defineSvgrPluginConfig","defineStorybookConfig","plugins","sourceMap","react","svgr","transformers","config","transformedConfig"],"mappings":";;;;;;;;;;;;;;AAC6E;AACH;AAC/B;AAC6C;AAaxF,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,YAAY;QACR,IAAI;QACJ,KAAK;IACT,CAAC,EACDC,QAAQN,8BAA8B,EACtCO,OAAOL,sBAAsB,EAC7BM,eAAe,EAAE,EACpB,GAAGP;IAEJ,MAAMQ,SAASX,
|
|
1
|
+
{"version":3,"file":"storybook.js","sources":["webpack://@workleap/rslib-configs/./src/storybook.ts"],"sourcesContent":["import type { RsbuildPlugins, SourceMap } from \"@rsbuild/core\";\nimport { pluginReact, type PluginReactOptions } from \"@rsbuild/plugin-react\";\nimport { pluginSvgr, type PluginSvgrOptions } from \"@rsbuild/plugin-svgr\";\nimport { defineConfig } from \"@rslib/core\";\nimport { applyTransformers, type RslibConfigTransformer } 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 transformers?: RslibConfigTransformer[];\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 transformers = []\n } = options;\n\n const config = defineConfig({\n lib: [{\n dts: false\n }],\n output: {\n target: \"web\",\n // Setting the clean option to true breaks the Storybook integration.\n cleanDistPath: false,\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 ]\n });\n\n const transformedConfig = applyTransformers(config, transformers, {\n environment: \"storybook\"\n });\n\n return defineConfig(transformedConfig);\n}\n"],"names":["pluginReact","pluginSvgr","defineConfig","applyTransformers","defaultDefineReactPluginConfig","options","defineSvgrPluginConfig","defineStorybookConfig","plugins","sourceMap","react","svgr","transformers","config","transformedConfig"],"mappings":";;;;;;;;;;;;;;AAC6E;AACH;AAC/B;AAC6C;AAaxF,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,YAAY;QACR,IAAI;QACJ,KAAK;IACT,CAAC,EACDC,QAAQN,8BAA8B,EACtCO,OAAOL,sBAAsB,EAC7BM,eAAe,EAAE,EACpB,GAAGP;IAEJ,MAAMQ,SAASX,YAAYA,CAAC;QACxB,KAAK;YAAC;gBACF,KAAK;YACT;SAAE;QACF,QAAQ;YACJ,QAAQ;YACR,qEAAqE;YACrE,eAAe;YACf,QAAQ;YACRO;QACJ;QACA,SAAS;YACLC,SAASV,WAAWA,CAACU,MAAM,CAAC;YAC5BC,QAAQV,UAAUA,CAACU,KAAK;gBACpB,aAAa;oBACT,YAAY;gBAChB;YACJ;eACGH;SACN;IACL;IAEA,MAAMM,oBAAoBX,iBAAiBA,CAACU,QAAQD,cAAc;QAC9D,aAAa;IACjB;IAEA,OAAOV,YAAYA,CAACY;AACxB"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@workleap/rslib-configs",
|
|
3
3
|
"author": "Workleap",
|
|
4
4
|
"description": "Workleap recommended Rslib configurations.",
|
|
5
|
-
"version": "1.0
|
|
5
|
+
"version": "1.1.0",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -28,22 +28,22 @@
|
|
|
28
28
|
"README.md"
|
|
29
29
|
],
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@rsbuild/core": "^1.
|
|
32
|
-
"@rslib/core": "^0.
|
|
31
|
+
"@rsbuild/core": "^1.4.7",
|
|
32
|
+
"@rslib/core": "^0.10.6"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@rsbuild/plugin-react": "^1.3.
|
|
36
|
-
"@rsbuild/plugin-svgr": "^1.2.
|
|
35
|
+
"@rsbuild/plugin-react": "^1.3.4",
|
|
36
|
+
"@rsbuild/plugin-svgr": "^1.2.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@rsbuild/core": "1.
|
|
40
|
-
"@rslib/core": "0.
|
|
41
|
-
"@types/node": "
|
|
39
|
+
"@rsbuild/core": "1.4.7",
|
|
40
|
+
"@rslib/core": "0.10.6",
|
|
41
|
+
"@types/node": "24.0.14",
|
|
42
42
|
"@typescript-eslint/parser": "8.32.1",
|
|
43
43
|
"eslint": "8.57.0",
|
|
44
44
|
"typescript": "5.8.3",
|
|
45
45
|
"vitest": "3.1.4",
|
|
46
|
-
"@workleap/eslint-plugin": "3.
|
|
46
|
+
"@workleap/eslint-plugin": "3.5.0",
|
|
47
47
|
"@workleap/typescript-configs": "3.0.4"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|