From a8596c8b4dec962147aca4064526046d2cc388ac Mon Sep 17 00:00:00 2001 From: Francesco Spilla Date: Fri, 7 Feb 2025 10:19:25 +0100 Subject: [PATCH] chore(repo): fix webpack breakpoints not binding --- .vscode/launch.json | 20 ++++++++++++++++++++ apps/ebitemp-api/webpack.config.js | 11 ++++++++--- 2 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..bb1013c --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,20 @@ +{ + // 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": "Attach to ebitemp-api", + "port": 9229, + "request": "attach", + "restart": true, + "skipFiles": [ + "/**", + "${workspaceFolder}/node_modules/**/*.js" + ], + "internalConsoleOptions": "neverOpen", + "type": "node" + } + ] +} diff --git a/apps/ebitemp-api/webpack.config.js b/apps/ebitemp-api/webpack.config.js index d768aa3..670604a 100644 --- a/apps/ebitemp-api/webpack.config.js +++ b/apps/ebitemp-api/webpack.config.js @@ -1,9 +1,14 @@ const { NxAppWebpackPlugin } = require('@nx/webpack/app-plugin'); -const { join } = require('path'); +const { join, relative } = require('path'); +const workspaceRoot = join(__dirname, '../../'); module.exports = { output: { path: join(__dirname, '../../dist/apps/ebitemp-api'), + devtoolModuleFilenameTemplate(info) { + const rel = relative(workspaceRoot, info.absoluteResourcePath); + return `webpack:///./${rel}`; + }, }, plugins: [ new NxAppWebpackPlugin({ @@ -11,10 +16,10 @@ module.exports = { compiler: 'tsc', main: './src/main.ts', tsConfig: './tsconfig.app.json', - assets: ["./src/assets"], + assets: ['./src/assets'], optimization: false, outputHashing: 'none', generatePackageJson: true, - }) + }), ], };