From d8eae35264514fa68ffae836f0776bcb573a201c Mon Sep 17 00:00:00 2001 From: Nickolay Lavrinenko Date: Mon, 14 Aug 2017 23:50:20 +0300 Subject: [PATCH 1/4] Update package.json Hi guys! I was investigating on how to turn on sourcemaps support in node environment and I found one similar topic where it was pointed to use "-s" flag for source building to achieve that (https://medium.com/@Cuadraman/how-to-use-babel-for-production-5b95e7323c2f). Since your example mentioned in official babel docs, would be great to include it in the example. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dd6bdbb..53e6e5a 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "lib/index.js", "scripts": { "start": "nodemon lib/index.js --exec babel-node --presets es2015,stage-2", - "build": "babel lib -d dist", + "build": "babel lib -d dist -s", "serve": "node dist/index.js", "test": "mocha --compilers js:babel-register" }, From e2cfc53bd438e36e11674c2646fba90ea8a179a1 Mon Sep 17 00:00:00 2001 From: Nickolay Lavrinenko Date: Tue, 15 Aug 2017 00:12:04 +0300 Subject: [PATCH 2/4] one extra line required to turn it on --- lib/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/index.js b/lib/index.js index 7e92581..e064087 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,3 +1,4 @@ +import 'source-map-support/register' import http from 'http'; http.createServer((req, res) => { From bda45ad9bc94526029c7d871bfb93b22360a2128 Mon Sep 17 00:00:00 2001 From: Nickolay Lavrinenko Date: Tue, 15 Aug 2017 00:14:19 +0300 Subject: [PATCH 3/4] fixed readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3b58df8..27898f1 100644 --- a/README.md +++ b/README.md @@ -154,7 +154,7 @@ Now we can remove the duplicated options from our npm scripts ```diff "scripts": { + "start": "nodemon lib/index.js --exec babel-node", -+ "build": "babel lib -d dist", ++ "build": "babel lib -d dist -s", "serve": "node dist/index.js" } ``` From e03c27b6c705c3a6014ff160bd265dc317c4684f Mon Sep 17 00:00:00 2001 From: Nickolay Lavrinenko Date: Tue, 15 Aug 2017 00:16:41 +0300 Subject: [PATCH 4/4] forgot semicolon --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index e064087..365b806 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,4 +1,4 @@ -import 'source-map-support/register' +import 'source-map-support/register'; import http from 'http'; http.createServer((req, res) => {