From 696658fb38fb77fb3a484c71dcd34debd20f7565 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Thu, 23 Sep 2021 23:35:38 +0300 Subject: [PATCH] Fix generated exports by library-builder package --- packages/library-builder/.eslintrc.js | 1 - packages/library-builder/src/update-package.ts | 10 ++++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/library-builder/.eslintrc.js b/packages/library-builder/.eslintrc.js index ecf652f..cacaebf 100644 --- a/packages/library-builder/.eslintrc.js +++ b/packages/library-builder/.eslintrc.js @@ -3,7 +3,6 @@ module.exports = { browser: true, es6: true, node: true, - mocha: true, }, extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'], globals: { diff --git a/packages/library-builder/src/update-package.ts b/packages/library-builder/src/update-package.ts index 3336907..de67081 100644 --- a/packages/library-builder/src/update-package.ts +++ b/packages/library-builder/src/update-package.ts @@ -25,7 +25,9 @@ export async function updatePackageJSON( ); // Get all exports - const data: Record = {}; + const data: Record = { + './*': './*', + }; if (packageData.main && packageData.module) { data['./'] = { require: formatExport(packageData.main), @@ -44,11 +46,7 @@ export async function updatePackageJSON( const dirKey = parts.join('/'); dirKeys.add(dirKey); - // Add entries for './foo' and './foo/' in addition to './foo/index' added below - data[dirKey + '/'] = { - require: key + '.js', - import: key + '.mjs', - }; + // Add entry for './foo' in addition to './foo/index' added below if (!data[dirKey]) { // Do not overwrite entry added as file data[dirKey] = {