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:
parent
f86317c7bf
commit
696658fb38
@ -3,7 +3,6 @@ module.exports = {
|
||||
browser: true,
|
||||
es6: true,
|
||||
node: true,
|
||||
mocha: true,
|
||||
},
|
||||
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
|
||||
globals: {
|
||||
|
@ -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] = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user