babel ES6 + node + vscode debugging environment project skeleton
- Remove
README.md
and create yours yarn add --dev babel-cli babel-preset-env babel-plugin-transform-object-rest-spread
- Add the following to your
package.json
"scripts": {
"start": "node dist/main.js",
"build": "babel src --out-dir dist --source-maps"
},
- Start your work in
src/main.js
- You can use vscode to debug your code
yarn add --dev source-map-support
- Put the following code at the top of
src/main.js
(before anyimport
orrequire
)
import 'source-map-support/register';
- Debug your code and
err.stack
will be source mapped