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 Jun 3, 2021
1 parent 64b377e commit cd6ec78
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions snowpack/src/sources/local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ export class PackageSourceLocal implements PackageSource {
}

// Check to see if this package is marked as external, in which case skip the build.
if(this.isExternal(_packageName, spec)) {
if (this.isExternal(_packageName, spec)) {
return;
}

Expand Down Expand Up @@ -682,7 +682,7 @@ export class PackageSourceLocal implements PackageSource {
const [packageName] = parsePackageImportSpecifier(spec);

// If this import is marked as external, do not transform the original spec
if(this.isExternal(packageName, spec)) {
if (this.isExternal(packageName, spec)) {
return spec;
}

Expand Down Expand Up @@ -742,7 +742,11 @@ export class PackageSourceLocal implements PackageSource {
private isExternal(packageName: string, specifier: string): boolean {
const {config} = this;
for (const external of config.packageOptions.external) {
if (packageName === external || specifier === external || packageName.startsWith(external + '/')) {
if (
packageName === external ||
specifier === external ||
packageName.startsWith(external + '/')
) {
return true;
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/snowpack/config/packageOptions.external/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ describe('packageOptions.external', () => {
external: ['some-thing/deep.js']
}
}
`
`,
});

expect(result['index.js']).toContain(`import 'some-thing/deep.js';`);
})
});
});

1 comment on commit cd6ec78

@vercel
Copy link

@vercel vercel bot commented on cd6ec78 Jun 3, 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.