Skip to content

Commit a7463e7

Browse files
authored
dedent
1 parent 9750a01 commit a7463e7

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

index.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -87,27 +87,27 @@ module.exports = function (options = {}) {
8787
}
8888
}
8989

90-
if (pkg) {
91-
// resolve pkg.svelte first for backwards compatibility
92-
// we should resolve it after exports longer-term
93-
if (entry === '.' && pkg.svelte) {
94-
return path.resolve(dir, pkg.svelte);
95-
}
90+
if (!pkg) return;
91+
92+
// resolve pkg.svelte first for backwards compatibility
93+
// we should resolve it after exports longer-term
94+
if (entry === '.' && pkg.svelte) {
95+
return path.resolve(dir, pkg.svelte);
96+
}
9697

97-
const resolved = await this.resolve(importee, importer, { skipSelf: true });
98+
const resolved = await this.resolve(importee, importer, { skipSelf: true });
9899

99-
// if we can't resolve this import without the `svelte` condition, warn the user
100-
if (!resolved) {
101-
try {
102-
resolve(pkg, entry, { conditions: ['svelte'] });
100+
// if we can't resolve this import without the `svelte` condition, warn the user
101+
if (!resolved) {
102+
try {
103+
resolve(pkg, entry, { conditions: ['svelte'] });
103104

104-
if (!warned) {
105-
console.error('\n\u001B[1m\u001B[31mWARNING: Your @rollup/plugin-node-resolve configuration\'s \'exportConditions\' array should include \'svelte\'. See https://github.com/sveltejs/rollup-plugin-svelte#svelte-exports-condition for more information\u001B[39m\u001B[22m\n');
106-
warned = true;
107-
}
108-
} catch (e) {
109-
// do nothing, this isn't a Svelte library
105+
if (!warned) {
106+
console.error('\n\u001B[1m\u001B[31mWARNING: Your @rollup/plugin-node-resolve configuration\'s \'exportConditions\' array should include \'svelte\'. See https://github.com/sveltejs/rollup-plugin-svelte#svelte-exports-condition for more information\u001B[39m\u001B[22m\n');
107+
warned = true;
110108
}
109+
} catch (e) {
110+
// do nothing, this isn't a Svelte library
111111
}
112112
}
113113
},

0 commit comments

Comments
 (0)