Skip to content

Commit

Permalink
fix: loading @builder.io/qwik/build (#632)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley authored Jun 17, 2022
1 parent f7c3ebe commit f287fe3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/qwik/src/optimizer/src/plugins/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,15 +275,15 @@ export function createPlugin(optimizerOptions: OptimizerOptions = {}) {
if (id === QWIK_BUILD_ID) {
log(`resolveId()`, 'Resolved', QWIK_BUILD_ID);
return {
id: path.resolve(opts.rootDir, QWIK_BUILD_ID),
id: normalizePath(path.resolve(opts.rootDir, QWIK_BUILD_ID)),
moduleSideEffects: false,
};
}

if (id.endsWith(QWIK_CLIENT_MANIFEST_ID)) {
log(`resolveId()`, 'Resolved', QWIK_CLIENT_MANIFEST_ID);
return {
id: path.resolve(opts.input[0], QWIK_CLIENT_MANIFEST_ID),
id: normalizePath(path.resolve(opts.input[0], QWIK_CLIENT_MANIFEST_ID)),
moduleSideEffects: false,
};
}
Expand Down Expand Up @@ -322,7 +322,7 @@ export function createPlugin(optimizerOptions: OptimizerOptions = {}) {
};

const load = async (_ctx: any, id: string, loadOpts: { ssr?: boolean } = {}) => {
if (id === QWIK_BUILD_ID) {
if (id.endsWith(QWIK_BUILD_ID)) {
log(`load()`, QWIK_BUILD_ID, opts.buildMode);
return {
moduleSideEffects: false,
Expand Down
3 changes: 2 additions & 1 deletion packages/qwik/src/optimizer/src/plugins/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
QWIK_JSX_RUNTIME_ID,
Q_MANIFEST_FILENAME,
QWIK_CLIENT_MANIFEST_ID,
QWIK_BUILD_ID,
} from './plugin';
import { createRollupError, normalizeRollupOutputOptions } from './rollup';
import { QWIK_LOADER_DEFAULT_DEBUG, QWIK_LOADER_DEFAULT_MINIFIED } from '../scripts';
Expand Down Expand Up @@ -135,7 +136,7 @@ export function qwikVite(qwikViteOpts: QwikVitePluginOptions = {}): any {
esbuild: { include: /\.js$/ },
optimizeDeps: {
include: [QWIK_CORE_ID, QWIK_JSX_RUNTIME_ID],
exclude: ['@vite/client', '@vite/env'],
exclude: ['@vite/client', '@vite/env', QWIK_BUILD_ID, QWIK_CLIENT_MANIFEST_ID],
},
build: {
outDir: opts.outDir,
Expand Down

0 comments on commit f287fe3

Please sign in to comment.