Skip to content

Commit

Permalink
[ci] yarn format
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp authored and actions-user committed Aug 10, 2021
1 parent 0e9829c commit ac2ed5c
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions snowpack/src/sources/local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,26 +325,23 @@ export class PackageSourceLocal implements PackageSource {
// Otherwise, resolve this specifier as an external package.
return await this.resolvePackageImport(spec, {source: entrypoint});
};
packageCode = await transformFileImports(
{type, contents: packageCode},
async (spec) => {
let resolvedImportUrl = await resolveImport(spec);
const importExtName = path.posix.extname(resolvedImportUrl);
const isProxyImport = importExtName && importExtName !== '.js' && importExtName !== '.mjs';
if (config.buildOptions.resolveProxyImports && isProxyImport) {
resolvedImportUrl = resolvedImportUrl + '.proxy.js';
}
imports.push(
createInstallTarget(
path.resolve(
path.posix.join(config.buildOptions.metaUrlPath, 'pkg', id),
resolvedImportUrl,
),
packageCode = await transformFileImports({type, contents: packageCode}, async (spec) => {
let resolvedImportUrl = await resolveImport(spec);
const importExtName = path.posix.extname(resolvedImportUrl);
const isProxyImport = importExtName && importExtName !== '.js' && importExtName !== '.mjs';
if (config.buildOptions.resolveProxyImports && isProxyImport) {
resolvedImportUrl = resolvedImportUrl + '.proxy.js';
}
imports.push(
createInstallTarget(
path.resolve(
path.posix.join(config.buildOptions.metaUrlPath, 'pkg', id),
resolvedImportUrl,
),
);
return resolvedImportUrl;
},
);
),
);
return resolvedImportUrl;
});
return {contents: packageCode, imports};
}

Expand Down

1 comment on commit ac2ed5c

@vercel
Copy link

@vercel vercel bot commented on ac2ed5c Aug 10, 2021

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.