Closed rosen-vladimirov closed 4 years ago
Acceptance criteria:
webpack.config.js
, debugging should work.diagnosticLogging: true
in launch.json
and start debugging. Ensure there's no Error when trying to require webpack.config.js file from path
in the generated log file from the extension. NOTE: Logs are located at %LOCALAPPDATA%\nativescript-extension.txt
file on Windows."sourceMapPathOverrides": {
"webpack:///*": "${workspaceRoot}/app/*",
"webpack://myLib/*": "invalid path/*"
}
The debugging should not work - this behavior verifies the extension will not overwrite the values specified by the user for sourceMapPathOverrides
.
There is an issue on Mac OS: Error when trying to require webpack.config.js file from path 'Users/test/Documents/webpack/js1/webpack.config.js'. Error is: Error: Cannot find module 'Users/test/Documents/webpack/js1/webpack.config.js'
Environment Provide version numbers for the following components (information can be retrieved by running
tns info
in your project folder or by inspecting thepackage.json
of the project):Describe the bug In case you set
output.library
in the webpack.config.js file, the application does not hit breakpoints in VSCode anymore.To Reproduce
$ tns create myApp --js
$ cd myApp
webpack.config.js
and addlibrary: "myLib"
in theconfig.output
section:Launch on Android
orLaunch on iOS
configuration.main-view-model.js
'sonTap
handler. The breakpoint will be red dot in case it is successfully placed and grayed out otherwise. We expect to have red dot, but it is gray.Expected behavior Debugging to work.
Sample project
Additional context The problem is in the parsing of the generated source maps - in case you parse them, the source URLs in them are in the following format:
while we expect them to start with
webpack:///
Workaround Add the following lines in your
launch.json
:Where
<app dir name>
is the name of yourapp
folder as defined innsconfig.json
(probably app or src) and<library name>
is the value ofoutput.library
fromwebpack.config.js
.For example, for the project created as described in the steps to reproduce, the snippet is: