diff --git a/packages/docs/src/routes/api/qwik-optimizer/api.json b/packages/docs/src/routes/api/qwik-optimizer/api.json index 686ac48fe8c..5177921196a 100644 --- a/packages/docs/src/routes/api/qwik-optimizer/api.json +++ b/packages/docs/src/routes/api/qwik-optimizer/api.json @@ -455,6 +455,48 @@ "editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts", "mdFile": "qwik.qwikbundlegraph.md" }, + { + "name": "qwikEsbuild", + "id": "qwikesbuild", + "hierarchy": [ + { + "name": "qwikEsbuild", + "id": "qwikesbuild" + } + ], + "kind": "Function", + "content": "Creates a Qwik esbuild plugin that transforms Qwik components and optimizes the build.\n\nThis plugin supports both real files (on disk) and virtual files (provided by bundlers like mdx-bundler). For virtual files that don't exist on the filesystem, the plugin will return undefined to let esbuild handle them through its virtual file system.\n\n\n```typescript\nexport declare function qwikEsbuild(qwikEsbuildOpts?: QwikEsbuildPluginOptions): Plugin;\n```\n\n\n
\n\nParameter\n\n\n | \n\nType\n\n\n | \n\nDescription\n\n\n |
---|---|---|
\n\nqwikEsbuildOpts\n\n\n | \n\n[QwikEsbuildPluginOptions](#qwikesbuildpluginoptions)\n\n\n | \n\n_(Optional)_\n\n\n |
\n\nProperty\n\n\n | \n\nModifiers\n\n\n | \n\nType\n\n\n | \n\nDescription\n\n\n |
---|---|---|---|
\n\n[assetsDir?](#)\n\n\n | \n\n\n | \n\nstring\n\n\n | \n\n_(Optional)_ Assets directory\n\n\n |
\n\n[buildMode?](#)\n\n\n | \n\n\n | \n\n[QwikBuildMode](#qwikbuildmode)\n\n\n | \n\n_(Optional)_ Build `production` or `development`.\n\nDefault `development`\n\n\n |
\n\n[csr?](#)\n\n\n | \n\n\n | \n\nboolean\n\n\n | \n\n_(Optional)_\n\n\n |
\n\n[debug?](#)\n\n\n | \n\n\n | \n\nboolean\n\n\n | \n\n_(Optional)_ Prints verbose Qwik plugin debug logs.\n\nDefault `false`\n\n\n |
\n\n[entryStrategy?](#)\n\n\n | \n\n\n | \n\n[EntryStrategy](#entrystrategy)\n\n\n | \n\n_(Optional)_ The Qwik entry strategy to use while building for production. During development the type is always `segment`.\n\nDefault `{ type: \"smart\" }`)\n\n\n |
\n\n[experimental?](#)\n\n\n | \n\n\n | \n\n(keyof typeof [ExperimentalFeatures](#experimentalfeatures))\\[\\]\n\n\n | \n\n_(Optional)_ Experimental features. These can come and go in patch releases, and their API is not guaranteed to be stable between releases.\n\n\n |
\n\n[input?](#)\n\n\n | \n\n\n | \n\nstring\\[\\] \\| string \\| { \\[entry: string\\]: string; }\n\n\n | \n\n_(Optional)_ Input files or entry points\n\n\n |
\n\n[lint?](#)\n\n\n | \n\n\n | \n\nboolean\n\n\n | \n\n_(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`\n\n\n |
\n\n[manifestInput?](#)\n\n\n | \n\n\n | \n\n[QwikManifest](#qwikmanifest)\n\n\n | \n\n_(Optional)_ The SSR build requires the manifest generated during the client build. The `manifestInput` option can be used to manually provide a manifest.\n\nDefault `undefined`\n\n\n |
\n\n[manifestOutput?](#)\n\n\n | \n\n\n | \n\n(manifest: [QwikManifest](#qwikmanifest)) => Promise<void> \\| void\n\n\n | \n\n_(Optional)_ The client build will create a manifest and this hook is called with the generated build data.\n\nDefault `undefined`\n\n\n |
\n\n[optimizerOptions?](#)\n\n\n | \n\n\n | \n\n[OptimizerOptions](#optimizeroptions)\n\n\n | \n\n_(Optional)_\n\n\n |
\n\n[outDir?](#)\n\n\n | \n\n\n | \n\nstring\n\n\n | \n\n_(Optional)_ Output directory\n\n\n |
\n\n[rootDir?](#)\n\n\n | \n\n\n | \n\nstring\n\n\n | \n\n_(Optional)_ The root of the application, which is commonly the same directory as `package.json` and `esbuild.config.js`.\n\nDefault `process.cwd()`\n\n\n |
\n\n[sourcemap?](#)\n\n\n | \n\n\n | \n\nboolean\n\n\n | \n\n_(Optional)_ Enable sourcemaps\n\n\n |
\n\n[srcDir?](#)\n\n\n | \n\n\n | \n\nstring\n\n\n | \n\n_(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.\n\nDefault `src`\n\n\n |
\n\n[srcInputs?](#)\n\n\n | \n\n\n | \n\n[TransformModuleInput](#transformmoduleinput)\\[\\] \\| null\n\n\n | \n\n_(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.\n\nDefault: `null`\n\n\n |
\n\n[target?](#)\n\n\n | \n\n\n | \n\n[QwikBuildTarget](#qwikbuildtarget)\n\n\n | \n\n_(Optional)_ Target `client` or `ssr`.\n\nDefault `client`\n\n\n |
\n\n[transformedModuleOutput?](#)\n\n\n | \n\n\n | \n\n((transformedModules: [TransformModule](#transformmodule)\\[\\]) => Promise<void> \\| void) \\| null\n\n\n | \n\n_(Optional)_ Hook that's called after the build and provides all of the transformed modules that were used before bundling.\n\n\n |
+ +Parameter + + | + +Type + + | + +Description + + |
---|---|---|
+ +qwikEsbuildOpts + + | + +[QwikEsbuildPluginOptions](#qwikesbuildpluginoptions) + + | + +_(Optional)_ + + |
+ +Property + + | + +Modifiers + + | + +Type + + | + +Description + + |
---|---|---|---|
+ +[assetsDir?](#) + + | + + | + +string + + | + +_(Optional)_ Assets directory + + |
+ +[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. + + |
+ +[input?](#) + + | + + | + +string[] \| string \| \{ [entry: string]: string; } + + | + +_(Optional)_ Input files or entry points + + |
+ +[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)_ + + |
+ +[outDir?](#) + + | + + | + +string + + | + +_(Optional)_ Output directory + + |
+ +[rootDir?](#) + + | + + | + +string + + | + +_(Optional)_ The root of the application, which is commonly the same directory as `package.json` and `esbuild.config.js`. + +Default `process.cwd()` + + |
+ +[sourcemap?](#) + + | + + | + +boolean + + | + +_(Optional)_ Enable sourcemaps + + |
+ +[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. + + |
\n\nParameter\n\n\n | \n\nType\n\n\n | \n\nDescription\n\n\n |
---|---|---|
\n\nopts\n\n\n | \n\n{ base?: string; scope?: string; path?: string; verbose?: boolean; fetchBundleGraph?: boolean; nonce?: string; }\n\n\n | \n\n\n |
\n\nParameter\n\n\n | \n\nType\n\n\n | \n\nDescription\n\n\n |
---|---|---|
\n\nopts\n\n\n | \n\n{ base?: string; scope?: string; path?: string; verbose?: boolean; fetchBundleGraph?: boolean; nonce?: string; }\n\n\n | \n\n\n |