Experience-Monks / devtool

[OBSOLETE] runs Node.js programs through Chromium DevTools
MIT License
3.76k stars 148 forks source link

Babel6 support #1

Open krainboltgreene opened 8 years ago

krainboltgreene commented 8 years ago

Hello! So my server is currently run with:

  "scripts": {
    "start": "npm-run-all --parallel lint server:development",
    "test": "echo \"Error: no test specified\" && exit 1",
    "server:development": "nodemon ./server/ --exec babel-node ..."
  },

How does this fit into the system?

mattdesl commented 8 years ago

I just added an ES2015 example. You could use a custom HTML index that registers babel, or you could just have your application entry point register babel.

https://github.com/Jam3/devtool/blob/master/example/es2015.js https://github.com/Jam3/devtool/blob/master/example/es2015.html

Another approach is to use babel to transpile your src/ folder (perhaps incrementally, if possible), and then have devtool just watch the dist folder.

devtool dist/index.js --watch dist/**/*.js
krainboltgreene commented 8 years ago

So for those looking for a s similar situation here's what I did:

Still trying to figure out how to integrate this with nodemon.

Salakar commented 8 years ago

A note, you can take advantage of node 5 features in electron - if you already do in your prod environment. So you can use the babel 6 preset babel-preset-es2015-node5 just fine. (as per my PR)