Skip to content

Commit

Permalink
fix: vite csr mode (QwikDev#4719)
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat authored Jul 4, 2023
1 parent 8bdcb24 commit 60b37a9
Show file tree
Hide file tree
Showing 7 changed files with 265 additions and 258 deletions.
6 changes: 3 additions & 3 deletions packages/docs/src/routes/api/qwik-optimizer/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@
}
],
"kind": "Interface",
"content": "```typescript\nexport interface QwikRollupPluginOptions \n```\n\n\n| Property | Modifiers | Type | Description |\n| --- | --- | --- | --- |\n| [buildMode?](#) | | [QwikBuildMode](#qwikbuildmode) | _(Optional)_ Build <code>production</code> or <code>development</code>. Default <code>development</code> |\n| [debug?](#) | | boolean | _(Optional)_ Prints verbose Qwik plugin debug logs. Default <code>false</code> |\n| [entryStrategy?](#) | | [EntryStrategy](#entrystrategy) | _(Optional)_ The Qwik entry strategy to use while building for production. During development the type is always <code>hook</code>. Default <code>{ type: &quot;smart&quot; }</code>) |\n| [manifestInput?](#) | | [QwikManifest](#qwikmanifest) | _(Optional)_ The SSR build requires the manifest generated during the client build. The <code>manifestInput</code> option can be used to manually provide a manifest. Default <code>undefined</code> |\n| [manifestOutput?](#) | | (manifest: [QwikManifest](#qwikmanifest)<!-- -->) =&gt; Promise&lt;void&gt; \\| void | _(Optional)_ The client build will create a manifest and this hook is called with the generated build data. Default <code>undefined</code> |\n| [optimizerOptions?](#) | | [OptimizerOptions](#optimizeroptions) | _(Optional)_ |\n| [rootDir?](#) | | string | _(Optional)_ The root of the application, which is commonly the same directory as <code>package.json</code> and <code>rollup.config.js</code>. Default <code>process.cwd()</code> |\n| [srcDir?](#) | | string | _(Optional)_ The source directory to find all the Qwik components. Since Qwik does not have a single input, the <code>srcDir</code> is used to recursively find Qwik files. Default <code>src</code> |\n| [srcInputs?](#) | | [TransformModuleInput](#transformmoduleinput)<!-- -->\\[\\] \\| null | _(Optional)_ Alternative to <code>srcDir</code>, where <code>srcInputs</code> is able to provide the files manually. This option is useful for an environment without a file system, such as a webworker. Default: <code>null</code> |\n| [target?](#) | | [QwikBuildTarget](#qwikbuildtarget) | _(Optional)_ Target <code>client</code> or <code>ssr</code>. Default <code>client</code> |\n| [transformedModuleOutput?](#) | | ((transformedModules: [TransformModule](#transformmodule)<!-- -->\\[\\]) =&gt; Promise&lt;void&gt; \\| void) \\| null | _(Optional)_ Hook that's called after the build and provides all of the transformed modules that were used before bundling. |",
"content": "```typescript\nexport interface QwikRollupPluginOptions \n```\n\n\n| Property | Modifiers | Type | Description |\n| --- | --- | --- | --- |\n| [buildMode?](#) | | [QwikBuildMode](#qwikbuildmode) | _(Optional)_ Build <code>production</code> or <code>development</code>. Default <code>development</code> |\n| [csr?](#) | | boolean | _(Optional)_ |\n| [debug?](#) | | boolean | _(Optional)_ Prints verbose Qwik plugin debug logs. Default <code>false</code> |\n| [entryStrategy?](#) | | [EntryStrategy](#entrystrategy) | _(Optional)_ The Qwik entry strategy to use while building for production. During development the type is always <code>hook</code>. Default <code>{ type: &quot;smart&quot; }</code>) |\n| [manifestInput?](#) | | [QwikManifest](#qwikmanifest) | _(Optional)_ The SSR build requires the manifest generated during the client build. The <code>manifestInput</code> option can be used to manually provide a manifest. Default <code>undefined</code> |\n| [manifestOutput?](#) | | (manifest: [QwikManifest](#qwikmanifest)<!-- -->) =&gt; Promise&lt;void&gt; \\| void | _(Optional)_ The client build will create a manifest and this hook is called with the generated build data. Default <code>undefined</code> |\n| [optimizerOptions?](#) | | [OptimizerOptions](#optimizeroptions) | _(Optional)_ |\n| [rootDir?](#) | | string | _(Optional)_ The root of the application, which is commonly the same directory as <code>package.json</code> and <code>rollup.config.js</code>. Default <code>process.cwd()</code> |\n| [srcDir?](#) | | string | _(Optional)_ The source directory to find all the Qwik components. Since Qwik does not have a single input, the <code>srcDir</code> is used to recursively find Qwik files. Default <code>src</code> |\n| [srcInputs?](#) | | [TransformModuleInput](#transformmoduleinput)<!-- -->\\[\\] \\| null | _(Optional)_ Alternative to <code>srcDir</code>, where <code>srcInputs</code> is able to provide the files manually. This option is useful for an environment without a file system, such as a webworker. Default: <code>null</code> |\n| [target?](#) | | [QwikBuildTarget](#qwikbuildtarget) | _(Optional)_ Target <code>client</code> or <code>ssr</code>. Default <code>client</code> |\n| [transformedModuleOutput?](#) | | ((transformedModules: [TransformModule](#transformmodule)<!-- -->\\[\\]) =&gt; Promise&lt;void&gt; \\| void) \\| null | _(Optional)_ Hook that's called after the build and provides all of the transformed modules that were used before bundling. |",
"editUrl": "https://github.com/BuilderIO/qwik/tree/main/packages/qwik/src/optimizer/src/plugins/rollup.ts",
"mdFile": "qwik.qwikrolluppluginoptions.md"
},
Expand Down Expand Up @@ -497,8 +497,8 @@
"id": "qwikvitepluginoptions"
}
],
"kind": "Interface",
"content": "```typescript\nexport interface QwikVitePluginOptions \n```\n\n\n| Property | Modifiers | Type | Description |\n| --- | --- | --- | --- |\n| [client?](#) | | { input?: string\\[\\] \\| string; devInput?: string; outDir?: string; manifestOutput?: (manifest: [QwikManifest](#qwikmanifest)<!-- -->) =&gt; Promise&lt;void&gt; \\| void; } | _(Optional)_ |\n| [debug?](#) | | boolean | _(Optional)_ Prints verbose Qwik plugin debug logs. Default <code>false</code> |\n| [devTools?](#) | | { clickToSource: string\\[\\] \\| false; } | _(Optional)_ |\n| [entryStrategy?](#) | | [EntryStrategy](#entrystrategy) | _(Optional)_ The Qwik entry strategy to use while building for production. During development the type is always <code>hook</code>. Default <code>{ type: &quot;smart&quot; }</code>) |\n| [optimizerOptions?](#) | | [OptimizerOptions](#optimizeroptions) | _(Optional)_ Options for the Qwik optimizer. Default <code>undefined</code> |\n| [srcDir?](#) | | string | _(Optional)_ The source directory to find all the Qwik components. Since Qwik does not have a single input, the <code>srcDir</code> is used to recursively find Qwik files. Default <code>src</code> |\n| [ssr?](#) | | { input?: string; outDir?: string; manifestInput?: [QwikManifest](#qwikmanifest)<!-- -->; } | _(Optional)_ |\n| [transformedModuleOutput?](#) | | ((transformedModules: [TransformModule](#transformmodule)<!-- -->\\[\\]) =&gt; Promise&lt;void&gt; \\| void) \\| null | _(Optional)_ Hook that's called after the build and provides all of the transformed modules that were used before bundling. |\n| [vendorRoots?](#) | | string\\[\\] | _(Optional)_ List of directories to recursively search for Qwik components or Vendors. Default <code>[]</code> |",
"kind": "TypeAlias",
"content": "```typescript\nexport type QwikVitePluginOptions = QwikVitePluginCSROptions | QwikVitePluginSSROptions;\n```",
"editUrl": "https://github.com/BuilderIO/qwik/tree/main/packages/qwik/src/optimizer/src/plugins/vite.ts",
"mdFile": "qwik.qwikvitepluginoptions.md"
},
Expand Down
17 changes: 4 additions & 13 deletions packages/docs/src/routes/api/qwik-optimizer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ export interface QwikRollupPluginOptions
| Property | Modifiers | Type | Description |
| ----------------------------- | --------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [buildMode?](#) | | [QwikBuildMode](#qwikbuildmode) | _(Optional)_ Build <code>production</code> or <code>development</code>. Default <code>development</code> |
| [csr?](#) | | boolean | _(Optional)_ |
| [debug?](#) | | boolean | _(Optional)_ Prints verbose Qwik plugin debug logs. Default <code>false</code> |
| [entryStrategy?](#) | | [EntryStrategy](#entrystrategy) | _(Optional)_ The Qwik entry strategy to use while building for production. During development the type is always <code>hook</code>. Default <code>{ type: &quot;smart&quot; }</code>) |
| [manifestInput?](#) | | [QwikManifest](#qwikmanifest) | _(Optional)_ The SSR build requires the manifest generated during the client build. The <code>manifestInput</code> option can be used to manually provide a manifest. Default <code>undefined</code> |
Expand Down Expand Up @@ -513,21 +514,11 @@ export interface QwikVitePluginApi
## QwikVitePluginOptions

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

| Property | Modifiers | Type | Description |
| ----------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [client?](#) | | { input?: string[] \| string; devInput?: string; outDir?: string; manifestOutput?: (manifest: [QwikManifest](#qwikmanifest)) =&gt; Promise&lt;void&gt; \| void; } | _(Optional)_ |
| [debug?](#) | | boolean | _(Optional)_ Prints verbose Qwik plugin debug logs. Default <code>false</code> |
| [devTools?](#) | | { clickToSource: string[] \| false; } | _(Optional)_ |
| [entryStrategy?](#) | | [EntryStrategy](#entrystrategy) | _(Optional)_ The Qwik entry strategy to use while building for production. During development the type is always <code>hook</code>. Default <code>{ type: &quot;smart&quot; }</code>) |
| [optimizerOptions?](#) | | [OptimizerOptions](#optimizeroptions) | _(Optional)_ Options for the Qwik optimizer. Default <code>undefined</code> |
| [srcDir?](#) | | string | _(Optional)_ The source directory to find all the Qwik components. Since Qwik does not have a single input, the <code>srcDir</code> is used to recursively find Qwik files. Default <code>src</code> |
| [ssr?](#) | | { input?: string; outDir?: string; manifestInput?: [QwikManifest](#qwikmanifest); } | _(Optional)_ |
| [transformedModuleOutput?](#) | | ((transformedModules: [TransformModule](#transformmodule)[]) =&gt; Promise&lt;void&gt; \| void) \| null | _(Optional)_ Hook that's called after the build and provides all of the transformed modules that were used before bundling. |
| [vendorRoots?](#) | | string[] | _(Optional)_ List of directories to recursively search for Qwik components or Vendors. Default <code>[]</code> |

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

## relative
Expand Down
31 changes: 6 additions & 25 deletions packages/qwik/src/optimizer/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ export function qwikRollup(qwikRollupOpts?: QwikRollupPluginOptions): any;
// @public (undocumented)
export interface QwikRollupPluginOptions {
buildMode?: QwikBuildMode;
// (undocumented)
csr?: boolean;
debug?: boolean;
entryStrategy?: EntryStrategy;
manifestInput?: QwikManifest;
Expand Down Expand Up @@ -309,32 +311,11 @@ export interface QwikVitePluginApi {
getRootDir: () => string | null;
}

// Warning: (ae-forgotten-export) The symbol "QwikVitePluginCSROptions" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "QwikVitePluginSSROptions" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export interface QwikVitePluginOptions {
// (undocumented)
client?: {
input?: string[] | string;
devInput?: string;
outDir?: string;
manifestOutput?: (manifest: QwikManifest) => Promise<void> | void;
};
debug?: boolean;
// (undocumented)
devTools?: {
clickToSource: string[] | false;
};
entryStrategy?: EntryStrategy;
optimizerOptions?: OptimizerOptions;
srcDir?: string;
// (undocumented)
ssr?: {
input?: string;
outDir?: string;
manifestInput?: QwikManifest;
};
transformedModuleOutput?: ((transformedModules: TransformModule[]) => Promise<void> | void) | null;
vendorRoots?: string[];
}
export type QwikVitePluginOptions = QwikVitePluginCSROptions | QwikVitePluginSSROptions;

// @public (undocumented)
export interface ResolvedManifest {
Expand Down
Loading

0 comments on commit 60b37a9

Please sign in to comment.