Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 3rd party imports of libs during build #5431

Merged
merged 2 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading