2
0
mirror of https://github.com/iconify/iconify.git synced 2025-01-26 00:28:28 +00:00

Fix generated exports by library-builder package

This commit is contained in:
Vjacheslav Trushkin 2021-09-23 23:35:38 +03:00
parent f86317c7bf
commit 696658fb38
2 changed files with 4 additions and 7 deletions

View File

@ -3,7 +3,6 @@ module.exports = {
browser: true,
es6: true,
node: true,
mocha: true,
},
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
globals: {

View File

@ -25,7 +25,9 @@ export async function updatePackageJSON(
);
// Get all exports
const data: Record<string, ExportRecord> = {};
const data: Record<string, ExportRecord | string> = {
'./*': './*',
};
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] = {