All Projects → kube → Vscode Ts Webpack Node Debug Example

kube / Vscode Ts Webpack Node Debug Example

VSCode TypeScript Webpack Node Debug Example

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to Vscode Ts Webpack Node Debug Example

Snappy
snAppy is a VS Code extension coupled with an interactive view to support your React front-end delivery.
Stars: ✭ 144 (+118.18%)
Mutual labels:  webpack, vscode
Gulp Webpack Starter
Gulp Webpack Starter - fast static website builder. The starter uses gulp toolkit and webpack bundler. Download to get an awesome development experience!
Stars: ✭ 199 (+201.52%)
Mutual labels:  webpack, webpack-configuration
Electron React Typescript Webpack Boilerplate
Pre-configured boilerplate for Electron + React + TypeScript + Webpack
Stars: ✭ 146 (+121.21%)
Mutual labels:  webpack, vscode
Serverless Webpack
Serverless plugin to bundle your lambdas with Webpack
Stars: ✭ 1,595 (+2316.67%)
Mutual labels:  webpack, webpack-configuration
Frontend Webpack Boilerplate
Simple starter webpack 5 project template supporting SASS/PostCSS, Babel ES7, browser syncing, code linting. Easy project setup having multiple features and developer friendly tools.
Stars: ✭ 242 (+266.67%)
Mutual labels:  webpack, webpack-configuration
Preact Minimal
🚀 Minimal preact structure
Stars: ✭ 136 (+106.06%)
Mutual labels:  webpack, webpack-configuration
Baumeister
👷 The aim of this project is to help you to build your things. From Bootstrap themes over static websites to single page applications.
Stars: ✭ 171 (+159.09%)
Mutual labels:  webpack, webpack-configuration
Alias Hq
The end-to-end solution for configuring, refactoring, maintaining and using path aliases
Stars: ✭ 77 (+16.67%)
Mutual labels:  webpack, vscode
Webpack Config
Helps to load, extend and merge webpack configs
Stars: ✭ 244 (+269.7%)
Mutual labels:  webpack, webpack-configuration
Wpk
a friendly, intuitive & intelligent CLI for webpack
Stars: ✭ 232 (+251.52%)
Mutual labels:  webpack, webpack-configuration
Webpack Core Usage
webpack2完整系列课程,欢迎阅读。同时欢迎移步我的react全家桶文章全集: https://github.com/liangklfangl/react-article-bucket
Stars: ✭ 94 (+42.42%)
Mutual labels:  webpack, webpack-configuration
Public
Repository for wallaby.js questions and issues
Stars: ✭ 662 (+903.03%)
Mutual labels:  webpack, vscode
Angular Librarian
An Angular 2+ scaffolding setup for creating libraries
Stars: ✭ 92 (+39.39%)
Mutual labels:  webpack, webpack-configuration
Sharejs
💻js小技巧、react、webpack、redux、javascript及其它前端干货,持续更新ing
Stars: ✭ 141 (+113.64%)
Mutual labels:  webpack, webpack-configuration
Auxpack
A dashboard for monitoring Webpack build stats.
Stars: ✭ 86 (+30.3%)
Mutual labels:  webpack, webpack-configuration
Webpack Config Handbook
Minimum Webpack config handbook & examples
Stars: ✭ 165 (+150%)
Mutual labels:  webpack, webpack-configuration
Nim
Streamline Your Node.js Debugging Workflow with Chromium (Chrome, Edge, More) DevTools.
Stars: ✭ 168 (+154.55%)
Mutual labels:  vscode, debugging
Angular Cli Webpack
Webpack configuration modifier for @angular/cli
Stars: ✭ 72 (+9.09%)
Mutual labels:  webpack, webpack-configuration
Webpack Chain
A chaining API to generate and simplify the modification of Webpack configurations.
Stars: ✭ 2,821 (+4174.24%)
Mutual labels:  webpack, webpack-configuration
Ts Monorepo
Template for setting up a TypeScript monorepo
Stars: ✭ 459 (+595.45%)
Mutual labels:  webpack, vscode

VSCode TypeScript Webpack Node Debug Example

A minimal setup for VSCode debug of NodeJS programs written in TypeScript and bundled using Webpack > 2.

This example also works for debugging the Electron Main Process.

TypeScript configuration

Enable sourceMap in tsconfig.json:

{
  "compilerOptions": {
    "sourceMap": true
  }
}

Webpack configuration

Sourcemaps

Enable sourcemaps in your Webpack configuration:

{
  devtool: 'cheap-source-map'
}

My personal pick is cheap-source-map, but you can check all available source-maps here.

All eval-based source maps won't work.

Sourcemaps Modules Absolute Paths

This will output the absolute path of your source files in the sourcemaps:

{
  output: {
    devtoolModuleFilenameTemplate: '[absolute-resource-path]'
  }
}

VSCode configuration

You need to create a launch.json in the .vscode folder at the root of your project.

{
  "configurations": [
    {
      "name": "Launch Program",
      "type": "node",
      "request": "launch",
      "cwd": "${workspaceRoot}",
      "program": "${workspaceRoot}/src/index.ts",
      "outFiles": [
        "${workspaceRoot}/dist/bundle.js"
      ],
      "sourceMaps": true
    }
  ]
}

Specify in "program" the source file corresponding to the entry-point of your program.

In "outFiles" specify the path to the bundle generated by Webpack.

Set "sourceMaps" to true.

Example

Clone this repo to test the debug and check the configuration:

git clone https://github.com/kube/vscode-ts-webpack-node-debug-example
cd vscode-ts-webpack-node-debug-example
npm install

Now:

  • Open the folder in VSCode
  • Place some breakpoints in the source code in src/
  • Build the project using + + B
  • Start debugging using F5

Enjoy.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].