Skip to content

Commit

Permalink
fixup! fix(qwik): Incorrect module reference in inlinedQrl
Browse files Browse the repository at this point in the history
  • Loading branch information
mhevery committed Oct 31, 2023
1 parent 97f1b0c commit 5d15c33
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/qwik/src/optimizer/src/plugins/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ export function createPlugin(optimizerOptions: OptimizerOptions = {}) {
}
const deps = new Set<string>();
for (const mod of newOutput.modules) {
if (mod.isEntry || mod.hook) {
if (isTransformedFile(mod)) {
const key = normalizePath(path.join(srcDir, mod.path));
currentOutputs.set(key, [mod, id]);
deps.add(key);
Expand Down Expand Up @@ -669,7 +669,7 @@ export function createPlugin(optimizerOptions: OptimizerOptions = {}) {

results.set(normalizedID, clientNewOutput);
for (const mod of clientNewOutput.modules) {
if (mod.isEntry || mod.hook) {
if (isTransformedFile(mod)) {
const key = normalizePath(path.join(srcDir, mod.path));
ctx.addWatchFile(key);
transformedOutputs.set(key, [mod, id]);
Expand All @@ -686,7 +686,7 @@ export function createPlugin(optimizerOptions: OptimizerOptions = {}) {
await ctx.load({ id });
}

const module = newOutput.modules.find((m) => !m.isEntry && m.hook == null)!;
const module = newOutput.modules.find((mod) => !isTransformedFile(mod))!;
return {
code: module.code,
map: module.map,
Expand Down Expand Up @@ -837,6 +837,10 @@ const insideRoots = (ext: string, dir: string, srcDir: string | null, vendorRoot
return false;
};

function isTransformedFile(mod: TransformModule) {
return mod.isEntry || mod.hook;
}

export function parseId(originalId: string) {
const [pathId, query] = originalId.split('?');
const queryStr = query || '';
Expand Down

0 comments on commit 5d15c33

Please sign in to comment.