@qse/edu-scripts 0.0.0-beta.0 → 0.0.0-beta.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.
@@ -181,8 +181,7 @@ function getWebpackConfig(args, override) {
181
181
  import: [
182
182
  {
183
183
  libraryName: "lodash",
184
- libraryDirectory: "",
185
- camel2DashComponentName: false
184
+ customName: "lodash/{{member}}"
186
185
  },
187
186
  ...override.import
188
187
  ]
@@ -4,9 +4,9 @@ import type { Configuration as DevServerConfiguration } from '@rspack/dev-server
4
4
  type ProxyConfigArray = NonNullable<DevServerConfiguration['proxy']>;
5
5
  export type BabelImportPlugin = {
6
6
  libraryName: string;
7
- libraryDirectory: string;
8
- camel2DashComponentName?: boolean;
9
- style?: boolean | 'css' | ((name: string) => string);
7
+ libraryDirectory?: string;
8
+ customName?: string;
9
+ style?: boolean | 'css' | string;
10
10
  };
11
11
  export type Config = {
12
12
  webpack?: (config: Configuration) => Configuration | undefined;
@@ -69,7 +69,14 @@ export type Config = {
69
69
  * @default false
70
70
  */
71
71
  decorators?: boolean;
72
- /** babel-plugin-import */
72
+ /**
73
+ * 与 babel-plugin-import 类似,但是内部是 rspack 重构,libraryDirectory 默认值是 lib
74
+ *
75
+ * 如果 libraryDirectory 传 ’‘ 则必须使用 customName 来写
76
+ *
77
+ * @see https://rspack.rs/zh/guide/features/builtin-swc-loader#rspackexperimentsimport
78
+ * @default [{libraryName: 'lodash', customName: 'lodash/{{member}}'}]
79
+ */
73
80
  import?: BabelImportPlugin[];
74
81
  };
75
82
  export declare function defineConfig(config: Config): Config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qse/edu-scripts",
3
- "version": "0.0.0-beta.0",
3
+ "version": "0.0.0-beta.1",
4
4
  "author": "Kinoko",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -205,8 +205,7 @@ export default function getWebpackConfig(args, override) {
205
205
  import: [
206
206
  {
207
207
  libraryName: 'lodash',
208
- libraryDirectory: '',
209
- camel2DashComponentName: false,
208
+ customName: 'lodash/{{member}}',
210
209
  },
211
210
  ...override.import,
212
211
  ],
@@ -6,9 +6,9 @@ type ProxyConfigArray = NonNullable<DevServerConfiguration['proxy']>
6
6
 
7
7
  export type BabelImportPlugin = {
8
8
  libraryName: string
9
- libraryDirectory: string
10
- camel2DashComponentName?: boolean
11
- style?: boolean | 'css' | ((name: string) => string)
9
+ libraryDirectory?: string
10
+ customName?: string
11
+ style?: boolean | 'css' | string
12
12
  }
13
13
 
14
14
  export type Config = {
@@ -73,7 +73,14 @@ export type Config = {
73
73
  * @default false
74
74
  */
75
75
  decorators?: boolean
76
- /** babel-plugin-import */
76
+ /**
77
+ * 与 babel-plugin-import 类似,但是内部是 rspack 重构,libraryDirectory 默认值是 lib
78
+ *
79
+ * 如果 libraryDirectory 传 ’‘ 则必须使用 customName 来写
80
+ *
81
+ * @see https://rspack.rs/zh/guide/features/builtin-swc-loader#rspackexperimentsimport
82
+ * @default [{libraryName: 'lodash', customName: 'lodash/{{member}}'}]
83
+ */
77
84
  import?: BabelImportPlugin[]
78
85
  }
79
86
  export function defineConfig(config: Config) {