Skip to content

Commit e4e5cca

Browse files
committed
fix(esm): shortcut index should point to valid esm
1 parent 5ab6beb commit e4e5cca

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/compiler/distribution/dist-esm.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ export async function generateEsmIndexes(config: d.Config, compilerCtx: d.Compil
1616

1717
async function generateEsmIndexShortcut(config: d.Config, compilerCtx: d.CompilerCtx, outputTarget: d.OutputTargetDist) {
1818
const indexPath = getDistEsmIndexPath(config, outputTarget);
19-
const contentJs = `export * from './es5/index.js';`;
19+
const contentJs = config.buildEs5
20+
? `export * from './es5/index.js';`
21+
: `export * from './es2017/index.js';`;
22+
2023
await compilerCtx.fs.writeFile(indexPath, contentJs);
2124
}
2225

0 commit comments

Comments
 (0)