API › @builder.io/qwik/optimizer
basename
basename(path: string, ext?: string): string;
パラメータ
型
説明
path
string
ext
string
(オプション)
string
ComponentEntryStrategy
export interface ComponentEntryStrategy
プロパティ
修飾子
型
説明
Record<string, string>
(オプション)
'component'
createOptimizer
createOptimizer: (optimizerOptions?: OptimizerOptions) => Promise<Optimizer>;
パラメータ
型
説明
optimizerOptions
(オプション)
Promise<Optimizer>
Diagnostic
export interface Diagnostic
プロパティ
修飾子
型
説明
string | null
string
string
string
string[] | null
DiagnosticCategory
export type DiagnosticCategory = "error" | "warning" | "sourceError";
dirname
dirname(path: string): string;
パラメータ
型
説明
path
string
string
EntryStrategy
export type EntryStrategy =
| InlineEntryStrategy
| HoistEntryStrategy
| SingleEntryStrategy
| HookEntryStrategy
| ComponentEntryStrategy
| SmartEntryStrategy;
参照: InlineEntryStrategy、SingleEntryStrategy、HookEntryStrategy、ComponentEntryStrategy、SmartEntryStrategy
extname
extname(path: string): string;
パラメータ
型
説明
path
string
string
format
format(pathObject: {
root: string;
dir: string;
base: string;
ext: string;
name: string;
}): string;
パラメータ
型
説明
pathObject
{ root: string; dir: string; base: string; ext: string; name: string; }
string
GlobalInjections
export interface GlobalInjections
プロパティ
修飾子
型
説明
{ [key: string]: string; }
(オプション)
'head' | 'body'
string
HookAnalysis
export interface HookAnalysis
プロパティ
修飾子
型
説明
string
boolean
'event' | 'function'
string
string
string | null
string
string
[number, number]
string
string
string | null
HookEntryStrategy
export interface HookEntryStrategy
プロパティ
修飾子
型
説明
Record<string, string>
(オプション)
'hook'
InlineEntryStrategy
export interface InlineEntryStrategy
プロパティ
修飾子
型
説明
'inline'
InsightManifest
export interface InsightManifest
プロパティ
修飾子
型
説明
Record<string, string>
{ route: string; symbols: string[]; }[]
'smart'
isAbsolute
isAbsolute(path: string): boolean;
パラメータ
型
説明
path
string
boolean
join
join(...paths: string[]): string;
パラメータ
型
説明
paths
string[]
string
MinifyMode
export type MinifyMode = "simplify" | "none";
normalize
normalize(path: string): string;
パラメータ
型
説明
path
string
string
Optimizer
export interface Optimizer
プロパティ
修飾子
型
説明
オプティマイザシステムの使用。これはカスタムファイルシステムで更新できます。
メソッド
説明
ファイルシステムからディレクトリを変換します。
ファイルシステムからディレクトリを変換します。
入力コード文字列を変換し、ファイルシステムにアクセスしません。
入力コード文字列を変換し、ファイルシステムにアクセスしません。
OptimizerOptions
export interface OptimizerOptions
プロパティ
修飾子
型
説明
any
(オプション)
number
(オプション) グローバルスタイルがこれより小さい場合はインライン化します
boolean
(オプション) ソースマップを有効にする
(オプション)
OptimizerSystem
export interface OptimizerSystem
プロパティ
修飾子
型
説明
() => string
(path: string) => Promise<any>
(rootDir: string) => Promise<TransformModuleInput[]>
(オプション)
string
(path: string) => Promise<any>
parse
parse(path: string): {
root: string;
dir: string;
base: string;
ext: string;
name: string;
};
パラメータ
型
説明
path
string
{ root: string; dir: string; base: string; ext: string; name: string; }
Path
export interface Path
プロパティ
修飾子
型
説明
readonly
string
readonly
readonly
string
readonly
null
メソッド
説明
QwikBuildMode
export type QwikBuildMode = "production" | "development";
QwikBuildTarget
export type QwikBuildTarget = "client" | "ssr" | "lib" | "test";
QwikBundle
export interface QwikBundle
プロパティ
修飾子
型
説明
string[]
(オプション)
string[]
(オプション)
string[]
(オプション)
number
string[]
(オプション)
QwikManifest
ビルドのメタデータ。その用途の1つは、QRLシンボルがどこにあるかを保存することです。
export interface QwikManifest
プロパティ
修飾子
型
説明
{ [fileName: string]: QwikBundle; }
すべてのコードバンドル。インポートグラフを知るために使用されます
(オプション) ドキュメントのheadに挿入するCSSなど
string
マニフェストのコンテンツハッシュ。これが変更された場合、コードが変更されました
{ [symbolName: string]: string; }
QRLの場所
{ target?: string; buildMode?: string; entryStrategy?: { [key: string]: any; }; }
(オプション)
{ [name: string]: string; }
(オプション)
{ [symbolName: string]: QwikSymbol; }
QRLシンボル
string
qwikRollup
export declare function qwikRollup(
qwikRollupOpts?: QwikRollupPluginOptions,
): any;
パラメータ
型
説明
qwikRollupOpts
(オプション)
any
QwikRollupPluginOptions
export interface QwikRollupPluginOptions
プロパティ
修飾子
型
説明
(オプション) production
またはdevelopment
をビルドします。
デフォルトはdevelopment
boolean
(オプション)
boolean
(オプション) 詳細なQwikプラグインデバッグログを出力します。
デフォルトはfalse
(オプション) 本番ビルドで使用するQwikエントリ戦略。開発中は、型は常にhook
です。
デフォルトは{ type: "smart" }
boolean
(オプション) SSRビルドまたは開発サーバーのソースファイルに対してeslintを実行します。これにより、大規模プロジェクトでの起動が遅くなる可能性があります。デフォルトはtrue
(オプション) SSRビルドでは、クライアントビルド中に生成されたマニフェストが必要です。manifestInput
オプションを使用すると、マニフェストを手動で提供できます。
デフォルトはundefined
(manifest: QwikManifest) => Promise<void> | void
(オプション) クライアントビルドはマニフェストを作成し、このフックが生成されたビルドデータで呼び出されます。
デフォルトはundefined
(オプション)
string
(オプション) アプリケーションのルート。これは通常、package.json
およびrollup.config.js
と同じディレクトリです。
デフォルトはprocess.cwd()
string
(オプション) すべてのQwikコンポーネントを見つけるためのソースディレクトリ。Qwikには単一の入力がないため、srcDir
を使用してQwikファイルを再帰的に検索します。
デフォルトはsrc
TransformModuleInput[] | null
(オプション) srcDir
の代替として、srcInputs
でファイルをマニュアルで指定できます。このオプションは、ウェブワーカーなど、ファイルシステムがない環境で役立ちます。
デフォルト: null
(オプション) 対象を client
または ssr
に設定します。
デフォルト: client
((transformedModules: TransformModule[]) => Promise<void> | void) | null
(オプション) ビルド後に呼び出され、バンドル前に使用されたすべての変換済みモジュールを提供するフックです。
QwikSymbol
export interface QwikSymbol
プロパティ
修飾子
型
説明
string
boolean
'function' | 'event'
string
string
string
[number, number]
string
string | null
qwikVite
export declare function qwikVite(qwikViteOpts?: QwikVitePluginOptions): any;
パラメータ
型
説明
qwikViteOpts
(オプション)
any
QwikViteDevResponse
export interface QwikViteDevResponse
プロパティ
修飾子
型
説明
Record<string, any>
(オプション)
() => void
(オプション)
QwikVitePlugin
export interface QwikVitePlugin
プロパティ
修飾子
型
説明
'vite-plugin-qwik'
QwikVitePluginApi
export interface QwikVitePluginApi
プロパティ
修飾子
型
説明
() => string | undefined
() => string | null
() => string | null
(clientOutDir?: string | null) => Promise<InsightManifest | null>
() => QwikManifest | null
() => Optimizer | null
() => NormalizedQwikPluginOptions
() => string | null
QwikVitePluginOptions
export type QwikVitePluginOptions =
| QwikVitePluginCSROptions
| QwikVitePluginSSROptions;
relative
relative(from: string, to: string): string;
パラメータ
型
説明
from
string
to
string
string
resolve
resolve(...paths: string[]): string;
パラメータ
型
説明
paths
string[]
string
ResolvedManifest
export interface ResolvedManifest
プロパティ
修飾子
型
説明
SingleEntryStrategy
export interface SingleEntryStrategy
プロパティ
修飾子
型
説明
Record<string, string>
(オプション)
'single'
SmartEntryStrategy
export interface SmartEntryStrategy
プロパティ
修飾子
型
説明
Record<string, string>
(オプション)
'smart'
SourceLocation
export interface SourceLocation
プロパティ
修飾子
型
説明
number
number
number
number
number
number
SourceMapsOption
export type SourceMapsOption = "external" | "inline" | undefined | null;
symbolMapper
このAPIは開発者向けのアルファプレビューとして提供されており、フィードバックに基づいて変更される可能性があります。本番環境ではこのAPIを使用しないでください。
特定のシンボル (onKeydown$
のような QRL) について、サーバーはシンボルがどのバンドルに含まれているかを知る必要があります。
通常、これは Qwik の q-manifest
によって提供されます。ただし、q-manifest
はクライアントのフルビルド後にのみ存在します。
これは開発モードでは問題になります。そのため、開発モードでは、以下の symbolMapper 関数を使用してシンボルが予想される URL にマッピングされます。Vite の場合、指定されたパスは特定のシンボルに対して固定されます。
symbolMapper: ReturnType<typeof createSymbolMapper>;
SymbolMapper
このAPIは開発者向けのアルファプレビューとして提供されており、フィードバックに基づいて変更される可能性があります。本番環境ではこのAPIを使用しないでください。
特定のシンボル (onKeydown$
のような QRL) について、サーバーはシンボルがどのバンドルに含まれているかを知る必要があります。
通常、これは Qwik の q-manifest
によって提供されます。ただし、q-manifest
はクライアントのフルビルド後にのみ存在します。
これは開発モードでは問題になります。そのため、開発モードでは、以下の symbolMapper 関数を使用してシンボルが予想される URL にマッピングされます。Vite の場合、指定されたパスは特定のシンボルに対して固定されます。
symbolMapper: ReturnType<typeof createSymbolMapper>;
SymbolMapperFn
export type SymbolMapperFn = (
symbolName: string,
mapper: SymbolMapper | undefined,
parent?: string,
) => readonly [symbol: string, chunk: string] | undefined;
参照: SymbolMapper
SystemEnvironment
export type SystemEnvironment =
| "node"
| "deno"
| "bun"
| "webworker"
| "browsermain"
| "unknown";
transformFs
ファイルシステムからディレクトリを変換します。
transformFs(opts: TransformFsOptions): Promise<TransformOutput>;
パラメータ
型
説明
opts
Promise<TransformOutput>
TransformFsOptions
export interface TransformFsOptions extends TransformOptions
拡張: TransformOptions
プロパティ
修飾子
型
説明
string[]
transformFsSync
ファイルシステムからディレクトリを変換します。
transformFsSync(opts: TransformFsOptions): TransformOutput;
パラメータ
型
説明
opts
TransformModule
export interface TransformModule
プロパティ
修飾子
型
説明
string
HookAnalysis | null
boolean
string | null
string | null
string
TransformModuleInput
export interface TransformModuleInput
プロパティ
修飾子
型
説明
string
string
transformModules
入力コード文字列を変換し、ファイルシステムにアクセスしません。
transformModules(opts: TransformModulesOptions): Promise<TransformOutput>;
パラメータ
型
説明
opts
Promise<TransformOutput>
TransformModulesOptions
export interface TransformModulesOptions extends TransformOptions
拡張: TransformOptions
プロパティ
修飾子
型
説明
transformModulesSync
入力コード文字列を変換し、ファイルシステムにアクセスしません。
transformModulesSync(opts: TransformModulesOptions): TransformOutput;
パラメータ
型
説明
opts
TransformOptions
export interface TransformOptions
プロパティ
修飾子
型
説明
(オプション)
boolean
(オプション)
boolean
(オプション)
(オプション)
EmitMode
(オプション)
boolean
(オプション)
string[]
(オプション)
string
(オプション)
string
(オプション)
boolean
(オプション)
string
string[]
(オプション)
boolean
(オプション)
string[]
(オプション)
boolean
(オプション)
boolean
(オプション)
TransformOutput
export interface TransformOutput
プロパティ
修飾子
型
説明
boolean
boolean
TranspileOption
export type TranspileOption = boolean | undefined | null;
versions
versions: {
qwik: string;
}