From f0e148ea8c8cc63dfbda2a0c78b379a5b05ba109 Mon Sep 17 00:00:00 2001 From: Arctic Ice Studio Date: Tue, 5 Mar 2019 09:42:39 +0100 Subject: [PATCH] Add VSCode debug configuration for the Gatsby build process This allows to debug Gatsby's development build process like the implemented Node APIs (`gatsby-node-js`) and the configuration (`gatsby-config.js`). GH-129 --- .vscode/launch.json | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..2df6fbfb --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2018-present Arctic Ice Studio + * Copyright (C) 2018-present Sven Greb + * + * Project: Nord Docs + * Repository: https://github.com/arcticicestudio/nord-docs + * License: MIT + */ + +/** + * The Visual Studio Code debug configuration for Gatsby. + * @author Arctic Ice Studio + * @author Sven Greb + * @since 0.10.0 + * @see https://github.com/Microsoft/vscode-recipes/tree/master/Gatsby-js + * @see https://www.gatsbyjs.org/docs/debugging-the-build-process + */ +{ + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Gatsby Development Build Process", + "program": "${workspaceRoot}/node_modules/gatsby/dist/bin/gatsby", + "args": ["develop"], + "runtimeArgs": [ + /* + * For performance reasons Node.js parses functions lazily on first access. + * As a consequence, breakpoints don't work in source code areas that haven't been parsed by Node.js. + * The `--nolazy` flag prevents the delayed parsing and ensures that breakpoints can be validated before + * running the code. + * + * @see https://nodejs.org/api/cli.html#cli_v8_options + */ + "--nolazy" + ], + "stopOnEntry": false, + "sourceMaps": false, + "internalConsoleOptions": "openOnSessionStart" + } + ] +}