devtool icon indicating copy to clipboard operation
devtool copied to clipboard

Babel6 support

Open krainboltgreene opened this issue 9 years ago • 3 comments

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?

krainboltgreene avatar Jan 19 '16 22:01 krainboltgreene

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

mattdesl avatar Jan 19 '16 22:01 mattdesl

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

  • Enable babel6 source mapping (.babelrc, "both")
  • Build your babel source
  • Run against build source

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

krainboltgreene avatar Jan 19 '16 22:01 krainboltgreene

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)

Salakar avatar Jan 21 '16 15:01 Salakar