From 74de3d9fa2552b5d1b0eb799638a657c9af67887 Mon Sep 17 00:00:00 2001 From: JounQin Date: Sun, 30 Jun 2019 15:27:27 +0800 Subject: [PATCH] feat: use types/typings/module first to use .d.ts whenever possible --- index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 665223e..1f577d6 100644 --- a/index.js +++ b/index.js @@ -92,9 +92,8 @@ function resolveFile(source, file, config) { }; } function packageFilter(pkg) { - if (pkg['jsnext:main']) { - pkg['main'] = pkg['jsnext:main']; - } + pkg.main = + pkg.types || pkg.typings || pkg.module || pkg['jsnext:main'] || pkg.main; return pkg; }