Skip to content

fix: pass options to silence warning #208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module.exports = function (options = {}) {
/**
* Resolve an import's full filepath.
*/
async resolveId(importee, importer) {
async resolveId(importee, importer, options) {
if (cache_emit.has(importee)) return importee;
if (
!importer ||
Expand Down Expand Up @@ -95,7 +95,7 @@ module.exports = function (options = {}) {
return path.resolve(dir, pkg.svelte);
}

const resolved = await this.resolve(importee, importer, { skipSelf: true });
const resolved = await this.resolve(importee, importer, { skipSelf: true, ...options });
Copy link
Member

Choose a reason for hiding this comment

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

not sure if legal to pass in from the outside, but to prevent endless loop it would be better to put skipSelf: true after the spread

Suggested change
const resolved = await this.resolve(importee, importer, { skipSelf: true, ...options });
const resolved = await this.resolve(importee, importer, { ...options, skipSelf: true });

Copy link
Member

Choose a reason for hiding this comment

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

looks like Lukas himself suggested putting it in front, so feel free to ignore this lightyen/typescript-paths#3 (comment)


// if we can't resolve this import without the `svelte` condition, warn the user
if (!resolved) {
Expand Down