Skip to content

Commit

Permalink
chore(rollup-config): Allow more builtins to avoid warnings (#933)
Browse files Browse the repository at this point in the history
I was noticing warnings for some imports, so I've updated our externalize functions to include bun and sveltekit ambient modules.
  • Loading branch information
blaine-arcjet authored Jun 12, 2024
1 parent 3cc0ae7 commit 2d6f4a0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion rollup-config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ export function createConfig(root, { plugins = [] } = {}) {
return peerDependencies.some((dep) => id.startsWith(dep));
}

function isBunBuiltin(id) {
return id === "bun";
}

function isSvelteKitBuiltin(id) {
return id === "$env/dynamic/private";
}

const rootDir = fileURLToPath(new URL(".", root));
const testDir = fileURLToPath(new URL("test/", root));

Expand Down Expand Up @@ -76,7 +84,9 @@ export function createConfig(root, { plugins = [] } = {}) {
isBuiltin(id) ||
isDependency(id) ||
isDevDependency(id) ||
isPeerDependency(id)
isPeerDependency(id) ||
isBunBuiltin(id) ||
isSvelteKitBuiltin(id)
);
},
plugins: [
Expand Down

0 comments on commit 2d6f4a0

Please sign in to comment.