After consulting the official manual, I have incorporated the following content into my launch.json
:
{
"version": "0.2.0",
"configurations": [
{
"name": "Gatsby build",
"type": "pwa-node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/.bin/gatsby",
"args": ["build"],
"runtimeArgs": ["--nolazy"],
"console": "integratedTerminal",
"runtimeExecutable": "/home/user/.asdf/shims/node"
}
]
}
Utilizing gatsby-plugin-ts-config, I am able to write my gatsby-node.ts
file in TypeScript. To achieve this, a gatsby-config.js
was created with the following setup:
const { generateConfig } = require('gatsby-plugin-ts-config');
const config = generateConfig({
configDir: '.gatsby'
});
module.exports = config;
Subsequently, a .gatsby/gatsby-node.ts
was added containing:
import { ITSConfigFn } from 'gatsby-plugin-ts-config';
const node: ITSConfigFn<'node'> = () => ({
onCreatePage: async ({ page, actions }) => {
console.log(page);
}
});
export default node;
A breakpoint was placed on the line featuring console.log(page);
.
Upon debugging using Gatsby build
, a new TypeScript file opens with the resulting code block.
(function (exports, require, module, __filename, __dirname) { "use strict";
exports.__esModule = true;
exports.default = void 0;
const node = () => ({
onCreatePage: async ({
page,
actions
}) => {
console.log(page);
}
});
var _default = node;
exports.default = _default;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdhdHNieS1ub2RlLnRzIl0sIm5hbWVzIjpbIm5vZGUiLCJvbkNyZWF0ZVBhZ2UiLCJwYWdlIiwiYWN0aW9ucyIsImNvbnNvbGUiLCJsb2ciXSwibWFwcGluZ3MiOiI7Ozs7O0FBRUEsTUFBTUEsSUFBeUIsR0FBRyxPQUFPO0FBQ3ZDQyxFQUFBQSxZQUFZLEVBQUUsT0FBTztBQUFFQyxJQUFBQSxJQUFGO0FBQVFDLElBQUFBO0FBQVIsR0FB...
It appears that the displayed file is not the original one. What could be causing Visual Studio Code to overlook the inline source map?
Further details
Code - OSS
Version: 1.50.1
Commit: d2e414d9e4239a252d1ab117bd7067f125afd80a
Date: 2020-10-15T10:42:48.064Z
Electron: 9.3.2
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Linux x64 5.9.1-arch1-1