Skip to content

Commit

Permalink
dedent
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm authored Feb 16, 2023
1 parent 9750a01 commit a7463e7
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,27 +87,27 @@ module.exports = function (options = {}) {
}
}

if (pkg) {
// resolve pkg.svelte first for backwards compatibility
// we should resolve it after exports longer-term
if (entry === '.' && pkg.svelte) {
return path.resolve(dir, pkg.svelte);
}
if (!pkg) return;

// resolve pkg.svelte first for backwards compatibility
// we should resolve it after exports longer-term
if (entry === '.' && pkg.svelte) {
return path.resolve(dir, pkg.svelte);
}

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

// if we can't resolve this import without the `svelte` condition, warn the user
if (!resolved) {
try {
resolve(pkg, entry, { conditions: ['svelte'] });
// if we can't resolve this import without the `svelte` condition, warn the user
if (!resolved) {
try {
resolve(pkg, entry, { conditions: ['svelte'] });

if (!warned) {
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');
warned = true;
}
} catch (e) {
// do nothing, this isn't a Svelte library
if (!warned) {
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');
warned = true;
}
} catch (e) {
// do nothing, this isn't a Svelte library
}
}
},
Expand Down

0 comments on commit a7463e7

Please sign in to comment.