Version
System:
OS: macOS 15.1
CPU: (12) arm64 Apple M2 Max
Memory: 79.05 MB / 32.00 GB
Shell: 3.7.1 - /opt/homebrew/bin/fish
Browsers:
Chrome: 130.0.6723.92
Safari: 18.1
npmPackages:
@rslib/core: ^0.0.15 => 0.0.15
Details
Cannot even set output.filename.js when autoExtension is false
Setup
package.json of workspace
rslib.config.ts
// ...
format: 'esm',
autoExtension: false,
output: {
filename: {
js: '[name].mjs'
}
}
// ...
format: 'cjs',
autoExtension: false,
output: {
filename: {
js: '[name].cjs'
}
}
// ...
Exepected
import xxx from './fooo.mjs' in esm output
aaa_require('./fooo.cjs') in cjs output
But got
import xxx from './fooo.js' in esm output
aaa_require('./fooo.js') in cjs output
Reproduce link
https://github.com/xc2/jbpr/blob/auto-extension-repro/sources/BUILD.ts
Reproduce Steps
ESM:
run pnpm rslib build -- //sources:esm and look into dist/lib
CJS:
run pnpm rslib build -- //sources:cjs and look into dist/lib