-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Labels
Description
Current Behavior
If you set outputFileName to main.mjs, it will still produce main.js.
If you set outputFileName to yeet.mjs, it will produce yeet.js.
It seems clear that it does not respect the file extension choice.
Expected Behavior
It should completely respect your file extension choice, including no file extension. If I put main.mjs in outputFileName, there should be a file produced called "main.mjs".
GitHub Repo
https://github.com/Wildboar-Software/directory
Steps to Reproduce
- In
project.jsonfor a project that builds with@nx/esbuild, setoutputFileNametoxyz.mjs. - Build it
- Observe that the created file is
xyz.js.
Nx Report
Node : 23.8.0
OS : linux-x64
Native Target : x86_64-linux
npm : 10.9.2
nx : 22.3.3
@nx/js : 22.3.3
@nx/eslint : 22.3.3
@nx/workspace : 22.3.3
@nx/jest : 22.3.3
@nx/devkit : 22.3.3
@nx/esbuild : 22.3.3
@nx/node : 22.3.3
@nx/vite : 22.3.3
@nx/vitest : 22.3.3
@nx/docker : 22.3.3
typescript : 5.9.3
---------------------------------------
Cache Usage: 11.49 MB / 91.47 GBFailure Logs
Package Manager Version
No response
Operating System
- macOS
- Linux
- Windows
- Other (Please specify)
Additional Information
Contents of the build job:
{
"executor": "@nx/esbuild:esbuild",
"outputs": ["{options.outputPath}"],
"options": {
"main": "apps/meerkat/src/main.ts",
"outputPath": "dist/apps/meerkat",
"outputFileName": "main.mjs",
"tsConfig": "apps/meerkat/tsconfig.app.json",
"platform": "node",
"format": ["esm"],
"generatePackageJson": true,
"esbuildOptions": {
"minify": false,
"banner": {
"js": "#!/bin/env node"
},
"footer": {
"js": "// Minified Meerkat DSA Javascript Source - Copyright (c) Wildboar Software 2025 - MIT License"
}
},
"assets": [
{
"glob": "apps/meerkat/README.md",
"input": "apps/meerkat/src",
"output": "."
},
{
"glob": "assets/**",
"input": "apps/meerkat/src",
"output": "."
},
{
"glob": "prisma/**",
"input": "apps/meerkat/src",
"output": "."
}
]
}
}