-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Source map sources relative to temporary output path #2218
Comments
FYI, I tried looking into the |
I am running into the same issue with AWS's SAM CLI. It copies the files to a folder inside /tmp/ before running esbuild. The source maps then end up looking like |
I've also happened to experience the same issue. It feels weird that we can't control this prefix since it's wrong when building into a dist directory and the source files are pointing to Are there any workarounds to this? |
A workaround is to use |
@jacobduba - did you ever find a workaround that worked with AWS SAM's integrated calls of esbuild? |
@jasonterando Since AWS SAM moved the code to a tmp directory, I submitted a PR to not move the code to a tmp directory. It fixed the issue but broke some other stuff so the maintainers rejected it. |
@jacobduba thanks for the reply. For now, I'll stick with calling esbuild from package.json, using nodemon to rebuild upon changes. For AWS SAM and VSCode users, I got the debugger working by configuring launch.json as follows: {
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug (Attach)",
"request": "attach",
"address": "localhost",
"skipFiles": [
"<node_internals>/**",
"/var/runtime/*",
"node_modules/**"
],
"type": "node",
"port": 5858,
"remoteRoot": "/var/task",
"localRoot": "${workspaceFolder}/.aws-sam/build/LambdaApi",
"sourceMaps": true,
"sourceMapPathOverrides": {
"../node_modules/*": "${workspaceFolder}/node_modules/*",
"../src/*": "${workspaceFolder}/src/*",
}
}
]
} |
Hi, Evan
Thanks for a wonderful library!
I have a question / something regarding the
sources
property of outputted (inline) sourcemaps. Given I have two files,.. and
.. and I build like the following
.. I get a nice
sources
property containing["foo.mjs", "index.mjs"]
. However, this is all outputted to stdout. I'm usingesbuild
in part with Cypress, a testing utility, and preprocessors of Cypress are provided a temporary file location in which they are expected to output bundles. Hence, we build likeAt that point, the
sources
property contains.. and it becomes impossible to use the sources and determine file locations programmatically without also knowing the build-time CWD and the temporary output directory.
Is there a way to build to a location and retain "nice" and library-friendly values for
sources
?Regards
Jonas
The text was updated successfully, but these errors were encountered: