@utoo/pack-shared 1.3.12-alpha.0 → 1.4.0-alpha.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/cjs/config.d.ts CHANGED
@@ -39,9 +39,15 @@ export type TurbopackRuleCondition = {
39
39
  query?: string | RegExp;
40
40
  contentType?: string | RegExp;
41
41
  };
42
+ export type TurbopackModuleType = "asset" | "ecmascript" | "typescript" | "css" | "css-module" | "json" | "wasm" | "raw" | "node" | "bytes";
42
43
  export type TurbopackRuleConfigItem = {
43
- loaders: TurbopackLoaderItem[];
44
+ loaders?: TurbopackLoaderItem[];
44
45
  as?: string;
46
+ /**
47
+ * Controls the configured module type for matching resources.
48
+ * Mapped to Turbopack's `ConfiguredModuleType`.
49
+ */
50
+ type?: TurbopackModuleType;
45
51
  condition?: TurbopackRuleCondition;
46
52
  };
47
53
  /**
@@ -228,6 +234,7 @@ export interface ConfigComplete {
228
234
  react?: {
229
235
  runtime?: "automatic" | "classic";
230
236
  importSource?: string;
237
+ absoluteSourceFilename?: boolean;
231
238
  };
232
239
  stats?: boolean;
233
240
  swcPlugins?: [string, any][];
@@ -235,6 +242,20 @@ export interface ConfigComplete {
235
242
  persistentCaching?: boolean;
236
243
  nodePolyfill?: boolean;
237
244
  devServer?: DevServerConfig;
245
+ server?: {
246
+ output?: {
247
+ /** Output path for server chunks, relative to project root. */
248
+ path?: string;
249
+ /** Entry chunk filename template. Supports [name]. */
250
+ filename?: string;
251
+ /** Non-entry chunk filename template. Supports [name] and [contenthash:N]. */
252
+ chunkFilename?: string;
253
+ };
254
+ functions?: {
255
+ /** Module that exports `callServer(actionId, args)` for client-side transport. */
256
+ callServerModule: string;
257
+ };
258
+ };
238
259
  }
239
260
  export interface HtmlConfig {
240
261
  template?: string;
@@ -470,7 +470,7 @@ function compatOptimization(webpackOptimization) {
470
470
  return;
471
471
  }
472
472
  const { moduleIds, minimize, concatenateModules, usedExports } = webpackOptimization;
473
- const enableWebpackUsedExports = usedExports !== false;
473
+ const enableWebpackUsedExports = typeof usedExports === "undefined" ? undefined : usedExports !== false;
474
474
  return {
475
475
  moduleIds: moduleIds === "named"
476
476
  ? "named"
package/esm/config.d.ts CHANGED
@@ -39,9 +39,15 @@ export type TurbopackRuleCondition = {
39
39
  query?: string | RegExp;
40
40
  contentType?: string | RegExp;
41
41
  };
42
+ export type TurbopackModuleType = "asset" | "ecmascript" | "typescript" | "css" | "css-module" | "json" | "wasm" | "raw" | "node" | "bytes";
42
43
  export type TurbopackRuleConfigItem = {
43
- loaders: TurbopackLoaderItem[];
44
+ loaders?: TurbopackLoaderItem[];
44
45
  as?: string;
46
+ /**
47
+ * Controls the configured module type for matching resources.
48
+ * Mapped to Turbopack's `ConfiguredModuleType`.
49
+ */
50
+ type?: TurbopackModuleType;
45
51
  condition?: TurbopackRuleCondition;
46
52
  };
47
53
  /**
@@ -228,6 +234,7 @@ export interface ConfigComplete {
228
234
  react?: {
229
235
  runtime?: "automatic" | "classic";
230
236
  importSource?: string;
237
+ absoluteSourceFilename?: boolean;
231
238
  };
232
239
  stats?: boolean;
233
240
  swcPlugins?: [string, any][];
@@ -235,6 +242,20 @@ export interface ConfigComplete {
235
242
  persistentCaching?: boolean;
236
243
  nodePolyfill?: boolean;
237
244
  devServer?: DevServerConfig;
245
+ server?: {
246
+ output?: {
247
+ /** Output path for server chunks, relative to project root. */
248
+ path?: string;
249
+ /** Entry chunk filename template. Supports [name]. */
250
+ filename?: string;
251
+ /** Non-entry chunk filename template. Supports [name] and [contenthash:N]. */
252
+ chunkFilename?: string;
253
+ };
254
+ functions?: {
255
+ /** Module that exports `callServer(actionId, args)` for client-side transport. */
256
+ callServerModule: string;
257
+ };
258
+ };
238
259
  }
239
260
  export interface HtmlConfig {
240
261
  template?: string;
@@ -467,7 +467,7 @@ function compatOptimization(webpackOptimization) {
467
467
  return;
468
468
  }
469
469
  const { moduleIds, minimize, concatenateModules, usedExports } = webpackOptimization;
470
- const enableWebpackUsedExports = usedExports !== false;
470
+ const enableWebpackUsedExports = typeof usedExports === "undefined" ? undefined : usedExports !== false;
471
471
  return {
472
472
  moduleIds: moduleIds === "named"
473
473
  ? "named"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utoo/pack-shared",
3
- "version": "1.3.12-alpha.0",
3
+ "version": "1.4.0-alpha.1",
4
4
  "main": "cjs/index.js",
5
5
  "module": "esm/index.js",
6
6
  "types": "esm/index.d.ts",