Skip to content

Commit

Permalink
merge #940
Browse files Browse the repository at this point in the history
  • Loading branch information
FredKSchott committed Aug 27, 2020
1 parent 75b23c3 commit 81322b0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions snowpack/src/commands/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,8 @@ export async function command(commandOptions: CommandOptions) {
}: {hasCssResource: boolean; sourceMap?: string; sourceMappingURL: string},
) {
// transform special requests
const stringCode = code as string;
if (isRoute) {
code = wrapHtmlResponse({code: stringCode, hmr: isHmr, config, mode: 'development'});
code = wrapHtmlResponse({code: code as string, hmr: isHmr, config, mode: 'development'});
} else if (isProxyModule) {
responseFileExt = '.js';
} else if (isSourceMap && sourceMap) {
Expand All @@ -510,14 +509,14 @@ export async function command(commandOptions: CommandOptions) {
// transform other files
switch (responseFileExt) {
case '.css': {
if (sourceMap) code = cssSourceMappingURL(stringCode, sourceMappingURL);
if (sourceMap) code = cssSourceMappingURL(code as string, sourceMappingURL);
break;
}
case '.js': {
if (isProxyModule) {
code = await wrapImportProxy({url: reqPath, code, hmr: isHmr, config});
} else {
code = wrapImportMeta({code: stringCode, env: true, hmr: isHmr, config});
code = wrapImportMeta({code: code as string, env: true, hmr: isHmr, config});
}

if (hasCssResource)
Expand Down Expand Up @@ -627,7 +626,6 @@ If Snowpack is having trouble detecting the import, add ${colors.bold(
}

const {code, map} = output[requestedFileExt];
if (typeof code !== 'string' && !isProxyModule) return code; // return binary files as-is
let finalResponse = code;

// Resolve imports.
Expand Down

1 comment on commit 81322b0

@vercel
Copy link

@vercel vercel bot commented on 81322b0 Aug 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.