# [API](/api.md) › @qwik.dev/core/optimizer

## basename

```typescript
basename(path: string, ext?: string): string;
```

| Parameter | Type | Description |
| --- | --- | --- |
| path | string |  |
| ext | string | _(Optional)_ |

**Returns:**

string

## blockSSR

## BundleGraphAdder

A function that returns a map of bundle names to their dependencies.

```typescript
export type BundleGraphAdder = (manifest: QwikManifest) => Record<
  string,
  {
    imports?: string[];
    dynamicImports?: string[];
  }
>;
```

**References:** [QwikManifest](#qwikmanifest)

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-vite/src/plugins/bundle-graph.ts)

## catchBoundary

## ComponentEntryStrategy

```typescript
export interface ComponentEntryStrategy
```

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| manual? |  | Record<string, string> | _(Optional)_ |
| type |  | 'component' |  |

## createOptimizer

```typescript
createOptimizer: (optimizerOptions?: OptimizerOptions) => Promise<Optimizer>;
```

| Parameter | Type | Description |
| --- | --- | --- |
| optimizerOptions | [OptimizerOptions](#optimizeroptions) | _(Optional)_ |

**Returns:**

Promise&lt;[Optimizer](#optimizer)&gt;

## DecoratorOptions

```typescript
export interface DecoratorOptions
```

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| emitDecoratorMetadata? |  | boolean | _(Optional)_ Tsconfig's `emitDecoratorMetadata` |
| legacy? |  | boolean | _(Optional)_ Tsconfig's `experimentalDecorators` |

## Diagnostic

```typescript
export interface Diagnostic
```

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| category |  | [DiagnosticCategory](#diagnosticcategory) |  |
| code |  | string \\| null |  |
| file |  | string |  |
| highlights |  | [SourceLocation](#sourcelocation)[] \\| null |  |
| message |  | string |  |
| scope |  | string |  |
| suggestions |  | string[] \\| null |  |

## DiagnosticCategory

```typescript
export type DiagnosticCategory = "error" | "warning" | "sourceError";
```

## dirname

```typescript
dirname(path: string): string;
```

| Parameter | Type | Description |
| --- | --- | --- |
| path | string |  |

**Returns:**

string

## each

## EmitMode

```typescript
export type EmitMode = "dev" | "prod" | "lib" | "hmr";
```

## EntryStrategy

```typescript
export type EntryStrategy =
  | InlineEntryStrategy
  | HoistEntryStrategy
  | SingleEntryStrategy
  | HookEntryStrategy
  | SegmentEntryStrategy
  | ComponentEntryStrategy
  | SmartEntryStrategy;
```

**References:** [InlineEntryStrategy](#inlineentrystrategy), [HoistEntryStrategy](#hoistentrystrategy), [SingleEntryStrategy](#singleentrystrategy), [HookEntryStrategy](#hookentrystrategy), [SegmentEntryStrategy](#segmententrystrategy), [ComponentEntryStrategy](#componententrystrategy), [SmartEntryStrategy](#smartentrystrategy)

## ExperimentalFeatures

Use `__EXPERIMENTAL__.x` to check if feature `x` is enabled. It will be replaced with `true` or `false` via an exact string replacement.

Add experimental features to this enum definition.

```typescript
export declare enum ExperimentalFeatures
```

| Member | Value | Description |
| --- | --- | --- |
| blockSSR | `"blockSSR"` | Enable the `blockSSR: false` route loader option |
| catchBoundary | `"catchBoundary"` | Enable the Catch primitive |
| each | `"each"` | Enable the Each keyed-list primitive |
| insights | `"insights"` | Enable the ability to use the Qwik Insights vite plugin and `` component |
| noSPA | `"noSPA"` | Disable SPA navigation handler in Qwik Router |
| pendingBoundary | `"pendingBoundary"` | Enable the Pending fallback primitive |
| show | `"show"` | Enable the Show conditional primitive |
| valibot | `"valibot"` | Enable the Valibot form validation |

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-vite/src/plugins/plugin.ts)

## extname

```typescript
extname(path: string): string;
```

| Parameter | Type | Description |
| --- | --- | --- |
| path | string |  |

**Returns:**

string

## format

```typescript
format(pathObject: {
        root: string;
        dir: string;
        base: string;
        ext: string;
        name: string;
    }): string;
```

| Parameter | Type | Description |
| --- | --- | --- |
| pathObject | \{ root: string; dir: string; base: string; ext: string; name: string; } |  |

**Returns:**

string

## GlobalInjections

```typescript
export interface GlobalInjections
```

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| attributes? |  | \{ [key: string]: string; } | _(Optional)_ |
| location |  | 'head' \\| 'body' |  |
| tag |  | string |  |

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-vite/src/types.ts)

## HoistEntryStrategy

```typescript
export interface HoistEntryStrategy
```

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| type |  | 'hoist' |  |

## HookEntryStrategy

> Warning: This API is now obsolete.
>
> Use SegmentStrategy instead

```typescript
export interface HookEntryStrategy
```

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| manual? |  | Record<string, string> | _(Optional)_ |
| type |  | 'hook' |  |

## InlineEntryStrategy

```typescript
export interface InlineEntryStrategy
```

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| type |  | 'inline' |  |

## insights

## isAbsolute

```typescript
isAbsolute(path: string): boolean;
```

| Parameter | Type | Description |
| --- | --- | --- |
| path | string |  |

**Returns:**

boolean

## join

```typescript
join(...paths: string[]): string;
```

| Parameter | Type | Description |
| --- | --- | --- |
| paths | string[] |  |

**Returns:**

string

## MinifyMode

```typescript
export type MinifyMode = "simplify" | "none";
```

## normalize

```typescript
normalize(path: string): string;
```

| Parameter | Type | Description |
| --- | --- | --- |
| path | string |  |

**Returns:**

string

## noSPA

## Optimizer

```typescript
export interface Optimizer
```

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| sys |  | [OptimizerSystem](#optimizersystem) | Optimizer system use. This can be updated with a custom file system. |

| Method | Description |
| --- | --- |
| [transformModules(opts)](#optimizer-transformmodules) | Transforms the input code string, does not access the file system. |

## OptimizerOptions

```typescript
export interface OptimizerOptions
```

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| \_optimizer? |  | unknown | _(Optional)_ |
| binding? |  | any | _(Optional)_ |
| inlineStylesUpToBytes? |  | number | _(Optional)_ Inline the global styles if they're smaller than this |
| sourcemap? |  | boolean | _(Optional)_ Enable sourcemaps |
| sys? |  | [OptimizerSystem](#optimizersystem) | _(Optional)_ |
| tsOptimizer? |  | boolean | _(Optional)_ Use the TypeScript optimizer (`@qwik.dev/ts-optimizer`) instead of the Rust one. The `QWIK_OPTIMIZER` environment variable (`ts` or `rust`) overrides this, so a project can be built or tested on the other optimizer without changing its config. Default `false` |

## OptimizerSystem

```typescript
export interface OptimizerSystem
```

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| cwd |  | () => string |  |
| dynamicImport |  | (path: string) => Promise<any> |  |
| env |  | [SystemEnvironment](#systemenvironment) |  |
| getInputFiles? |  | (rootDir: string) => Promise<[TransformModuleInput](#transformmoduleinput)[]> | _(Optional)_ |
| os |  | string |  |
| path |  | [Path](#path) |  |
| strictDynamicImport |  | (path: string) => Promise<any> |  |

## parse

```typescript
parse(path: string): {
        root: string;
        dir: string;
        base: string;
        ext: string;
        name: string;
    };
```

| Parameter | Type | Description |
| --- | --- | --- |
| path | string |  |

**Returns:**

\{ root: string; dir: string; base: string; ext: string; name: string; }

## Path

```typescript
export interface Path
```

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| delimiter | `readonly` | string |  |
| posix | `readonly` | [Path](#path) |  |
| sep | `readonly` | string |  |
| win32 | `readonly` | null |  |

| Method | Description |
| --- | --- |
| [basename(path, ext)](#path-basename) |  |
| [dirname(path)](#path-dirname) |  |
| [extname(path)](#path-extname) |  |
| [format(pathObject)](#path-format) |  |
| [isAbsolute(path)](#path-isabsolute) |  |
| [join(paths)](#path-join) |  |
| [normalize(path)](#path-normalize) |  |
| [parse(path)](#path-parse) |  |
| [relative(from, to)](#path-relative) |  |
| [resolve(paths)](#path-resolve) |  |

## pendingBoundary

## QwikAsset

```typescript
export interface QwikAsset
```

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| name |  | string \\| undefined | Name of the asset |
| size |  | number | Size of the asset |

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-vite/src/types.ts)

## QwikBuildMode

```typescript
export type QwikBuildMode = "production" | "development";
```

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-vite/src/plugins/plugin.ts)

## QwikBuildTarget

```typescript
export type QwikBuildTarget = "client" | "ssr" | "lib" | "test";
```

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-vite/src/plugins/plugin.ts)

## QwikBundle

```typescript
export interface QwikBundle
```

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| dynamicImports? |  | string[] | _(Optional)_ Dynamic imports |
| imports? |  | string[] | _(Optional)_ Direct imports |
| interactivity? |  | number | _(Optional)_ Interactivity score of the bundle |
| origins? |  | string[] | _(Optional)_ Source files of the bundle |
| qrlImports? |  | string[] | _(Optional)_ Dynamic imports of qrl segments, the subset of `dynamicImports` the preloader follows |
| size |  | number | Size of the bundle |
| symbols? |  | string[] | _(Optional)_ Symbols in the bundle |
| total |  | number | Total size of this bundle's static import graph |

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-vite/src/types.ts)

## QwikBundleGraph

Bundle graph.

Format: [ 'bundle-a.js', 3, 5 // Depends on 'bundle-b.js' and 'bundle-c.js' 'bundle-b.js', 5, // Depends on 'bundle-c.js' 'bundle-c.js', ]

```typescript
export type QwikBundleGraph = Array<string | number>;
```

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-vite/src/types.ts)

## QwikManifest

The metadata of the build. One of its uses is storing where QRL symbols are located.

```typescript
export interface QwikManifest
```

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| assets? |  | \{ [fileName: string]: [QwikAsset](#qwikasset); } | _(Optional)_ All assets. The key is the fileName relative to the rootDir |
| bundleGraph? |  | [QwikBundleGraph](#qwikbundlegraph) | _(Optional)_ All bundles in a compact graph format with probabilities |
| bundleGraphAsset? |  | string | _(Optional)_ The bundle graph fileName |
| bundles |  | \{ [fileName: string]: [QwikBundle](#qwikbundle); } | All code bundles, used to know the import graph. The key is the bundle fileName relative to "build/" |
| core? |  | string | _(Optional)_ The Qwik core bundle fileName |
| injections? |  | [GlobalInjections](#globalinjections)[] | _(Optional)_ CSS etc to inject in the document head |
| manifestHash |  | string | Content hash of the manifest, if this changes, the code changed |
| mapping |  | \{ [symbolName: string]: string; } | Where QRLs are located. The key is the symbol name, the value is the bundle fileName |
| options? |  | \{ target?: string; buildMode?: string; entryStrategy?: \{ type: [EntryStrategy](#entrystrategy)['type']; }; } | _(Optional)_ The options used to build the manifest |
| platform? |  | \{ [name: string]: string; } | _(Optional)_ The platform used to build the manifest |
| preloader? |  | string | _(Optional)_ The preloader bundle fileName |
| qwikLoader? |  | string | _(Optional)_ The Qwik loader bundle fileName |
| symbols |  | \{ [symbolName: string]: [QwikSymbol](#qwiksymbol); } | QRL symbols |
| version |  | string | The version of the manifest |

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-vite/src/types.ts)

## qwikRolldown

```typescript
export declare function qwikRolldown(
  qwikRolldownOpts?: QwikRolldownPluginOptions,
): any;
```

| Parameter | Type | Description |
| --- | --- | --- |
| qwikRolldownOpts | [QwikRolldownPluginOptions](#qwikrolldownpluginoptions) | _(Optional)_ |

**Returns:**

any

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-vite/src/plugins/rolldown.ts)

## QwikRolldownPluginOptions

```typescript
export interface QwikRolldownPluginOptions
```

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| buildMode? |  | [QwikBuildMode](#qwikbuildmode) | _(Optional)_ Build `production` or `development`. Default `development` |
| csr? |  | boolean | _(Optional)_ |
| debug? |  | boolean | _(Optional)_ Prints verbose Qwik plugin debug logs. Default `false` |
| entryStrategy? |  | [EntryStrategy](#entrystrategy) | _(Optional)_ The Qwik entry strategy to use while building for production. During development the type is always `segment`. Default `{ type: "smart" }`) |
| experimental? |  | (keyof typeof [ExperimentalFeatures](#experimentalfeatures))[] | _(Optional)_ Experimental features. These can come and go in patch releases, and their API is not guaranteed to be stable between releases. |
| lint? |  | boolean | _(Optional)_ Run eslint on the source files for the ssr build or dev server. This can slow down startup on large projects. Defaults to `true` |
| manifestInput? |  | [QwikManifest](#qwikmanifest) | _(Optional)_ The SSR build requires the manifest generated during the client build. The `manifestInput` option can be used to manually provide a manifest. Default `undefined` |
| manifestOutput? |  | (manifest: [QwikManifest](#qwikmanifest)) => Promise<void> \\| void | _(Optional)_ The client build will create a manifest and this hook is called with the generated build data. Default `undefined` |
| optimizerOptions? |  | [OptimizerOptions](#optimizeroptions) | _(Optional)_ |
| rootDir? |  | string | _(Optional)_ The root of the application, which is commonly the same directory as `package.json` and `rollup.config.js`. Default `process.cwd()` |
| srcDir? |  | string | _(Optional)_ The source directory to find all the Qwik components. Since Qwik does not have a single input, the `srcDir` is used to recursively find Qwik files. Default `src` |
| srcInputs? |  | [TransformModuleInput](#transformmoduleinput)[] \\| null | _(Optional)_ Alternative to `srcDir`, where `srcInputs` is able to provide the files manually. This option is useful for an environment without a file system, such as a webworker. Default: `null` |
| target? |  | [QwikBuildTarget](#qwikbuildtarget) | _(Optional)_ Target `client` or `ssr`. Default `client` |
| transformedModuleOutput? |  | ((transformedModules: [TransformModule](#transformmodule)[]) => Promise<void> \\| void) \\| null | _(Optional)_ Hook that's called after the build and provides all of the transformed modules that were used before bundling. |

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-vite/src/plugins/rolldown.ts)

## qwikRollup

> Warning: This API is now obsolete.
>
> Use `qwikRolldown`.

Renamed to `qwikRolldown`.

```typescript
qwikRollup: typeof qwikRolldown;
```

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-vite/src/plugins/rolldown.ts)

## QwikRollupPluginOptions

> Warning: This API is now obsolete.
>
> Use `QwikRolldownPluginOptions`.

Renamed to `QwikRolldownPluginOptions`.

```typescript
export type QwikRollupPluginOptions = QwikRolldownPluginOptions;
```

**References:** [QwikRolldownPluginOptions](#qwikrolldownpluginoptions)

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-vite/src/plugins/rolldown.ts)

## QwikSymbol

```typescript
export interface QwikSymbol
```

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| canonicalFilename |  | string |  |
| captureNames? |  | string[] | _(Optional)_ The transformed names of scoped variables, if any |
| captures |  | boolean | Whether the symbol captures a variable |
| ctxKind |  | 'function' \\| 'eventHandler' |  |
| ctxName |  | string |  |
| displayName |  | string |  |
| hash |  | string |  |
| loc |  | [number, number] |  |
| origin |  | string |  |
| paramNames? |  | string[] | _(Optional)_ The parameter names if it's a function with parameters |
| parent |  | string \\| null |  |

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-vite/src/types.ts)

## qwikVite

The types for Vite/Rolldown don't allow us to be too specific about the return type. The correct return type is `[QwikVitePlugin, VitePlugin<never>]`, and if you search the plugin by name you'll get the `QwikVitePlugin`.

```typescript
export declare function qwikVite(qwikViteOpts?: QwikVitePluginOptions): any;
```

| Parameter | Type | Description |
| --- | --- | --- |
| qwikViteOpts | [QwikVitePluginOptions](#qwikvitepluginoptions) | _(Optional)_ |

**Returns:**

any

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-vite/src/plugins/vite.ts)

## QwikVitePlugin

This is the type of the "pre" Qwik Vite plugin. `qwikVite` actually returns a tuple of two plugins, but after Vite flattens them, you can find the plugin by name.

```typescript
export type QwikVitePlugin = P<QwikVitePluginApi> & {
  name: "vite-plugin-qwik";
};
```

**References:** [QwikVitePluginApi](#qwikvitepluginapi)

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-vite/src/plugins/vite.ts)

## QwikVitePluginApi

```typescript
export interface QwikVitePluginApi
```

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| getClientOutDir |  | () => string \\| null |  |
| getClientPublicOutDir |  | () => string \\| null |  |
| getManifest |  | () => [QwikManifest](#qwikmanifest) \\| null |  |
| getOptimizer |  | () => [Optimizer](#optimizer) \\| null |  |
| getOptions |  | () => NormalizedQwikPluginOptions |  |
| getRootDir |  | () => string \\| null |  |
| onSegment |  | (callback: SegmentCallback) => void | Register a callback that fires for each segment emitted during transform. |
| registerBundleGraphAdder |  | (adder: [BundleGraphAdder](#bundlegraphadder)) => void |  |

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-vite/src/plugins/vite.ts)

## QwikVitePluginOptions

```typescript
export type QwikVitePluginOptions =
  | QwikVitePluginCSROptions
  | QwikVitePluginSSROptions;
```

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-vite/src/plugins/vite.ts)

## relative

```typescript
relative(from: string, to: string): string;
```

| Parameter | Type | Description |
| --- | --- | --- |
| from | string |  |
| to | string |  |

**Returns:**

string

## resolve

```typescript
resolve(...paths: string[]): string;
```

| Parameter | Type | Description |
| --- | --- | --- |
| paths | string[] |  |

**Returns:**

string

## ResolvedManifest

```typescript
export interface ResolvedManifest
```

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| bundleGraph? |  | [QwikBundleGraph](#qwikbundlegraph) | _(Optional)_ |
| injections? |  | [GlobalInjections](#globalinjections)[] | _(Optional)_ |
| manifest |  | [ServerQwikManifest](#serverqwikmanifest) |  |
| mapper |  | [SymbolMapper](#symbolmapper) |  |

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-vite/src/types.ts)

## SegmentAnalysis

```typescript
export interface SegmentAnalysis
```

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| canonicalFilename |  | string |  |
| captureNames? |  | string[] | _(Optional)_ The transformed names of scoped variables, if any |
| captures |  | boolean |  |
| ctxKind |  | 'eventHandler' \\| 'function' |  |
| ctxName |  | string |  |
| displayName |  | string |  |
| entry |  | string \\| null |  |
| extension |  | string |  |
| hash |  | string |  |
| loc |  | [number, number] |  |
| name |  | string |  |
| origin |  | string |  |
| paramNames? |  | string[] | _(Optional)_ The parameter names if it's a function with parameters |
| parent |  | string \\| null |  |

## SegmentEntryStrategy

```typescript
export interface SegmentEntryStrategy
```

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| manual? |  | Record<string, string> | _(Optional)_ |
| type |  | 'segment' |  |

## ServerQwikManifest

The manifest values that are needed for SSR.

```typescript
export type ServerQwikManifest = Pick<
  QwikManifest,
  | "manifestHash"
  | "injections"
  | "bundleGraph"
  | "bundleGraphAsset"
  | "mapping"
  | "preloader"
  | "core"
  | "qwikLoader"
>;
```

**References:** [QwikManifest](#qwikmanifest)

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-vite/src/types.ts)

## show

## SingleEntryStrategy

```typescript
export interface SingleEntryStrategy
```

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| manual? |  | Record<string, string> | _(Optional)_ |
| type |  | 'single' |  |

## SmartEntryStrategy

```typescript
export interface SmartEntryStrategy
```

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| manual? |  | Record<string, string> | _(Optional)_ |
| type |  | 'smart' |  |

## SourceLocation

```typescript
export interface SourceLocation
```

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| endCol |  | number |  |
| endLine |  | number |  |
| hi |  | number |  |
| lo |  | number |  |
| startCol |  | number |  |
| startLine |  | number |  |

## SymbolMapper

```typescript
export type SymbolMapper = Record<
  string,
  readonly [symbol: string, chunk: string]
>;
```

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-vite/src/types.ts)

## SymbolMapperFn

```typescript
export type SymbolMapperFn = (
  symbolName: string,
  mapper: SymbolMapper | undefined,
  parent?: string,
) => readonly [symbol: string, chunk: string] | undefined;
```

**References:** [SymbolMapper](#symbolmapper)

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-vite/src/types.ts)

## SystemEnvironment

```typescript
export type SystemEnvironment =
  | "node"
  | "deno"
  | "bun"
  | "webworker"
  | "browsermain"
  | "unknown";
```

## TransformModule

```typescript
export interface TransformModule
```

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| code |  | string |  |
| imports? |  | string[] | _(Optional)_ |
| isEntry |  | boolean |  |
| map |  | string \\| null |  |
| origPath |  | string \\| null |  |
| path |  | string |  |
| segment |  | [SegmentAnalysis](#segmentanalysis) \\| null |  |

## TransformModuleInput

```typescript
export interface TransformModuleInput
```

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| code |  | string |  |
| devPath? |  | string | _(Optional)_ |
| path |  | string |  |

## transformModules

Transforms the input code string, does not access the file system.

```typescript
transformModules(opts: TransformModulesOptions): Promise<TransformOutput>;
```

| Parameter | Type | Description |
| --- | --- | --- |
| opts | [TransformModulesOptions](#transformmodulesoptions) |  |

**Returns:**

Promise&lt;[TransformOutput](#transformoutput)&gt;

## TransformModulesOptions

```typescript
export interface TransformModulesOptions extends TransformOptions
```

**Extends:** [TransformOptions](#transformoptions)

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| input |  | [TransformModuleInput](#transformmoduleinput)[] |  |

## TransformOptions

```typescript
export interface TransformOptions
```

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| decorator? |  | [DecoratorOptions](#decoratoroptions) | _(Optional)_ Decorator lowering, mirroring tsconfig. Only the TypeScript optimizer applies it. |
| entryStrategy? |  | [EntryStrategy](#entrystrategy) | _(Optional)_ |
| explicitExtensions? |  | boolean | _(Optional)_ |
| isServer? |  | boolean | _(Optional)_ |
| minify? |  | [MinifyMode](#minifymode) | _(Optional)_ |
| mode? |  | [EmitMode](#emitmode) | _(Optional)_ |
| preserveFilenames? |  | boolean | _(Optional)_ |
| regCtxName? |  | string[] | _(Optional)_ |
| rootDir? |  | string | _(Optional)_ |
| scope? |  | string | _(Optional)_ |
| sourceMaps? |  | boolean | _(Optional)_ |
| srcDir |  | string |  |
| stripCtxName? |  | string[] | _(Optional)_ |
| stripEventHandlers? |  | boolean | _(Optional)_ |
| stripExports? |  | string[] | _(Optional)_ |
| transpileJsx? |  | boolean | _(Optional)_ |
| transpileTs? |  | boolean | _(Optional)_ |

## TransformOutput

```typescript
export interface TransformOutput
```

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| diagnostics |  | [Diagnostic](#diagnostic)[] |  |
| isJsx |  | boolean |  |
| isTypeScript |  | boolean |  |
| modules |  | [TransformModule](#transformmodule)[] |  |

## valibot
