-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Added a build:dev yarn task to PVA Publish to create source maps #4831
Conversation
entry: './src/node/index.ts', | ||
mode: isDevelopment ? 'development' : 'production', | ||
target: 'node', | ||
devtool: isDevelopment ? 'source-map' : undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be the other way around?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want it to behave like this:
if (isDevelopment)
// generate source maps
else
// don't generate source maps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting. it's usually the other way around. until we start reporting errors, I guess it doesn't matter too much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would think you would want source maps when developing so you can step through your code and work out any bugs, and then you would not want them in production to reduce size and because you aren't often debugging the production code.
We also don't copy the source files of the extensions into the production app so the source maps wouldn't even work would they?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally, you would use something like cheap-eval-source-map
for dev because of build speed. In this case, we aren't concerned as much with build speed.
The source mapping might actually be a little wonky... I need to investigate and see if the breakpoints are being hit properly |
I tested the branch with a clean build and the source maps are working as expected 👍 |
…#4831) * Added a build:dev yarn task to create working node-side sourcemaps * Added missing newline * Fixed up dev config Co-authored-by: Andy Brown <asbrown002@gmail.com> Co-authored-by: Soroush <hatpick@gmail.com>
…microsoft#4831) * Added a build:dev yarn task to create working node-side sourcemaps * Added missing newline * Fixed up dev config Co-authored-by: Andy Brown <asbrown002@gmail.com> Co-authored-by: Soroush <hatpick@gmail.com>
…#4831) * Added a build:dev yarn task to create working node-side sourcemaps * Added missing newline * Fixed up dev config Co-authored-by: Andy Brown <asbrown002@gmail.com> Co-authored-by: Soroush <hatpick@gmail.com>
…microsoft#4831) * Added a build:dev yarn task to create working node-side sourcemaps * Added missing newline * Fixed up dev config Co-authored-by: Andy Brown <asbrown002@gmail.com> Co-authored-by: Soroush <hatpick@gmail.com>
Description
Webpack-generated source maps for the node-side code of the PVA publish extension do not work inside of VS Code and are not recognized by the debugger.
I have added a
yarn build:dev
task that will skip webpack when compiling the node code and will instead pass it totsc
to be compiled. Thetsc
-generated source maps do work with the debugger.This should have no effect on the current production environment, and the developer will have to explicitly opt-in to this mode by calling
yarn build:dev
.#minor