Skip to content

Commit

Permalink
fix: 3rd party imports of libs during build (#5431)
Browse files Browse the repository at this point in the history
Co-authored-by: Miško Hevery <[email protected]>
  • Loading branch information
shairez and mhevery authored Nov 13, 2023
1 parent cc74a38 commit ada0768
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ export interface RequestEventBase<PLATFORM = QwikCityPlatform>
| Property | Modifiers | Type | Description |
| ----------------- | --------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [basePathname](#) | <code>readonly</code> | string | The base pathname of the request, which can be configured at build time. Defaults to <code>/</code>. |
| [cacheControl](#) | <code>readonly</code> | (cacheControl: [CacheControl](#cachecontrol), target?: CacheControlTarget) =&gt; void | <p>Convenience method to set the Cache-Control header. Depending on your CDN, you may want to add another cacheControl with the second argument set to <code>CDN-Cache-Control</code> or any other value (we provide the most common values for auto-complete, but you can use any string you want).</p><p>See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control and https://qwik.builder.io/docs/caching/#CDN-Cache-Controls for more information.</p> |
| [cacheControl](#) | <code>readonly</code> | (cacheControl: [CacheControl](#cachecontrol), target?: CacheControlTarget) =&gt; void | <p>Convenience method to set the Cache-Control header. Depending on your CDN, you may want to add another cacheControl with the second argument set to <code>CDN-Cache-Control</code> or any other value (we provide the most common values for auto-complete, but you can use any string you want).</p><p>See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control and https://qwik.builder.io/docs/caching/\#CDN-Cache-Controls for more information.</p> |
| [clientConn](#) | <code>readonly</code> | [ClientConn](#clientconn) | Provides information about the client connection, such as the IP address and the country the request originated from. |
| [cookie](#) | <code>readonly</code> | [Cookie](#cookie) | <p>HTTP request and response cookie. Use the <code>get()</code> method to retrieve a request cookie value. Use the <code>set()</code> method to set a response cookie value.</p><p>https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies</p> |
| [env](#) | <code>readonly</code> | [EnvGetter](#envgetter) | Platform provided environment variables. |
Expand Down
12 changes: 6 additions & 6 deletions packages/qwik/src/optimizer/src/plugins/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { createOptimizer } from '../optimizer';
import type { Rollup } from 'vite';
import { hashCode } from '../../../core/util/hash_code';
import { generateManifestFromBundles, getValidManifest } from '../manifest';
import { createOptimizer } from '../optimizer';
import type {
Diagnostic,
EntryStrategy,
Expand All @@ -17,8 +19,6 @@ import type {
TransformOutput,
} from '../types';
import { createLinter, type QwikLinter } from './eslint-plugin';
import type { Rollup } from 'vite';
import { hashCode } from '../../../core/util/hash_code';

const REG_CTX_NAME = ['server'];

Expand Down Expand Up @@ -445,10 +445,10 @@ export function createPlugin(optimizerOptions: OptimizerOptions = {}) {
const transformedOutput = isSSR
? ssrTransformedOutputs.get(importer)
: transformedOutputs.get(importer);
const p = transformedOutput?.[0].origPath;
if (p) {
const originalPath = transformedOutput?.[0].origPath || transformedOutput?.[1];
if (originalPath) {
// Resolve imports relative to original source path
return ctx.resolve(id, p, { skipSelf: true });
return ctx.resolve(id, originalPath, { skipSelf: true });
}
return;
}
Expand Down

0 comments on commit ada0768

Please sign in to comment.