@utoo/pack-shared 1.2.8 → 1.2.10-alpha.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/cjs/config.d.ts CHANGED
@@ -43,14 +43,26 @@ export type TurbopackRuleCondition = {
43
43
  } | TurbopackLoaderBuiltinCondition | {
44
44
  path?: string | RegExp;
45
45
  content?: RegExp;
46
+ query?: string | RegExp;
47
+ contentType?: string | RegExp;
46
48
  };
47
49
  export type TurbopackRuleConfigItem = {
48
50
  loaders: TurbopackLoaderItem[];
49
51
  as?: string;
50
52
  condition?: TurbopackRuleCondition;
51
53
  };
54
+ /**
55
+ * This can be an object representing a single configuration, or a list of
56
+ * loaders and/or rule configuration objects.
57
+ *
58
+ * - A list of loader path strings or objects is the "shorthand" syntax.
59
+ * - A list of rule configuration objects can be useful when each configuration
60
+ * object has different `condition` fields, but still match the same top-level
61
+ * path glob.
62
+ */
63
+ export type TurbopackRuleConfigCollection = TurbopackRuleConfigItem | (TurbopackLoaderItem | TurbopackRuleConfigItem)[];
52
64
  export interface ModuleOptions {
53
- rules?: Record<string, TurbopackRuleConfigItem>;
65
+ rules?: Record<string, TurbopackRuleConfigCollection>;
54
66
  }
55
67
  export interface ResolveOptions {
56
68
  alias?: Record<string, string | string[] | Record<string, string | string[]>>;
@@ -89,6 +101,8 @@ export interface ConfigComplete {
89
101
  type?: "standalone" | "export";
90
102
  filename?: string;
91
103
  chunkFilename?: string;
104
+ cssFilename?: string;
105
+ assetModuleFilename?: string;
92
106
  clean?: boolean;
93
107
  copy?: Array<{
94
108
  from: string;
@@ -146,7 +160,6 @@ export interface ConfigComplete {
146
160
  useLightningcss?: boolean;
147
161
  };
148
162
  styledComponents?: boolean | StyledComponentsConfig;
149
- emotion?: boolean | EmotionConfig;
150
163
  };
151
164
  images?: {
152
165
  inlineLimit?: number;
@@ -197,19 +210,6 @@ export interface StyledComponentsConfig {
197
210
  pure?: boolean;
198
211
  cssProp?: boolean;
199
212
  }
200
- export interface EmotionConfig {
201
- sourceMap?: boolean;
202
- autoLabel?: "dev-only" | "always" | "never";
203
- labelFormat?: string;
204
- importMap?: {
205
- [importName: string]: {
206
- [exportName: string]: {
207
- canonicalImport?: [string, string];
208
- styledBaseImport?: [string, string];
209
- };
210
- };
211
- };
212
- }
213
213
  export interface BundleOptions {
214
214
  /**
215
215
  * The utoo pack configs.
package/esm/config.d.ts CHANGED
@@ -43,14 +43,26 @@ export type TurbopackRuleCondition = {
43
43
  } | TurbopackLoaderBuiltinCondition | {
44
44
  path?: string | RegExp;
45
45
  content?: RegExp;
46
+ query?: string | RegExp;
47
+ contentType?: string | RegExp;
46
48
  };
47
49
  export type TurbopackRuleConfigItem = {
48
50
  loaders: TurbopackLoaderItem[];
49
51
  as?: string;
50
52
  condition?: TurbopackRuleCondition;
51
53
  };
54
+ /**
55
+ * This can be an object representing a single configuration, or a list of
56
+ * loaders and/or rule configuration objects.
57
+ *
58
+ * - A list of loader path strings or objects is the "shorthand" syntax.
59
+ * - A list of rule configuration objects can be useful when each configuration
60
+ * object has different `condition` fields, but still match the same top-level
61
+ * path glob.
62
+ */
63
+ export type TurbopackRuleConfigCollection = TurbopackRuleConfigItem | (TurbopackLoaderItem | TurbopackRuleConfigItem)[];
52
64
  export interface ModuleOptions {
53
- rules?: Record<string, TurbopackRuleConfigItem>;
65
+ rules?: Record<string, TurbopackRuleConfigCollection>;
54
66
  }
55
67
  export interface ResolveOptions {
56
68
  alias?: Record<string, string | string[] | Record<string, string | string[]>>;
@@ -89,6 +101,8 @@ export interface ConfigComplete {
89
101
  type?: "standalone" | "export";
90
102
  filename?: string;
91
103
  chunkFilename?: string;
104
+ cssFilename?: string;
105
+ assetModuleFilename?: string;
92
106
  clean?: boolean;
93
107
  copy?: Array<{
94
108
  from: string;
@@ -146,7 +160,6 @@ export interface ConfigComplete {
146
160
  useLightningcss?: boolean;
147
161
  };
148
162
  styledComponents?: boolean | StyledComponentsConfig;
149
- emotion?: boolean | EmotionConfig;
150
163
  };
151
164
  images?: {
152
165
  inlineLimit?: number;
@@ -197,19 +210,6 @@ export interface StyledComponentsConfig {
197
210
  pure?: boolean;
198
211
  cssProp?: boolean;
199
212
  }
200
- export interface EmotionConfig {
201
- sourceMap?: boolean;
202
- autoLabel?: "dev-only" | "always" | "never";
203
- labelFormat?: string;
204
- importMap?: {
205
- [importName: string]: {
206
- [exportName: string]: {
207
- canonicalImport?: [string, string];
208
- styledBaseImport?: [string, string];
209
- };
210
- };
211
- };
212
- }
213
213
  export interface BundleOptions {
214
214
  /**
215
215
  * The utoo pack configs.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utoo/pack-shared",
3
- "version": "1.2.8",
3
+ "version": "1.2.10-alpha.0",
4
4
  "main": "cjs/index.js",
5
5
  "module": "esm/index.js",
6
6
  "types": "esm/index.d.ts",