Skip to content

Commit 532354e

Browse files
committed
šŸ› Fix loading extended browserslist config when no targets are given
Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
1 parent d8fdaad commit 532354e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

ā€Žsrc/plugin.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,20 @@ export function corejsPlugin(
3333
format: "esm",
3434
modules: options.modules,
3535
exclude: options.exclude,
36-
targets: options.targets || browserslist.loadConfig({}),
36+
targets:
37+
options.targets ||
38+
(browserslist.findConfig(".") || browserslist.loadConfig({})
39+
? browserslist()
40+
: undefined),
3741
summary: {
3842
comment: options.summary,
3943
},
4044
}
4145

46+
if (process.env.NODE_ENV === "development") {
47+
console.debug("browser targets", config.targets)
48+
}
49+
4250
return {
4351
name: "core-js",
4452
async transform(code, id) {

0 commit comments

Comments
Ā (0)