{"action":"created","issue":{"url":"https://api.github.com/repos/sequelize/cli/issues/112","repository_url":"https://api.github.com/repos/sequelize/cli","labels_url":"https://api.github.com/repos/sequelize/cli/issues/112/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/cli/issues/112/comments","events_url":"https://api.github.com/repos/sequelize/cli/issues/112/events","html_url":"https://github.com/sequelize/cli/issues/112","id":64816821,"number":112,"title":"Work with babel","user":{"login":"fundon","id":27926,"avatar_url":"https://avatars.githubusercontent.com/u/27926?v=3","gravatar_id":"","url":"https://api.github.com/users/fundon","html_url":"https://github.com/fundon","followers_url":"https://api.github.com/users/fundon/followers","following_url":"https://api.github.com/users/fundon/following{/other_user}","gists_url":"https://api.github.com/users/fundon/gists{/gist_id}","starred_url":"https://api.github.com/users/fundon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fundon/subscriptions","organizations_url":"https://api.github.com/users/fundon/orgs","repos_url":"https://api.github.com/users/fundon/repos","events_url":"https://api.github.com/users/fundon/events{/privacy}","received_events_url":"https://api.github.com/users/fundon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":24,"created_at":"2015-03-27T17:50:24Z","updated_at":"2016-07-24T09:58:30Z","closed_at":null,"body":"Hi, currently I write ES6+ code and use [Babel](http://babeljs.io/) transform them.\r\n\r\nMaybe we can include it and add an option for it.\r\n\r\nLike this below:\r\n```js\r\n\r\n# lib/gulpfile.js\r\n\r\n\"use strict\";\r\n\r\nrequire(\"babel/register\");\r\n\r\nvar gulp    = require(\"gulp\");\r\nvar path    = require(\"path\");\r\nvar fs      = require(\"fs\");\r\nvar helpers = require(path.resolve(__dirname, \"helpers\"));\r\n\r\nrequire(\"gulp-help\")(gulp, {\r\n  aliases: [\"h\"],\r\n  afterPrintCallback: helpers.gulp.printManuals\r\n});\r\n\r\n...\r\n\r\n```\r\n\r\nIf you like this, I can submit a PR."},"comment":{"url":"https://api.github.com/repos/sequelize/cli/issues/comments/234768341","html_url":"https://github.com/sequelize/cli/issues/112#issuecomment-234768341","issue_url":"https://api.github.com/repos/sequelize/cli/issues/112","id":234768341,"user":{"login":"AndreSteenveld","id":6936,"avatar_url":"https://avatars.githubusercontent.com/u/6936?v=3","gravatar_id":"","url":"https://api.github.com/users/AndreSteenveld","html_url":"https://github.com/AndreSteenveld","followers_url":"https://api.github.com/users/AndreSteenveld/followers","following_url":"https://api.github.com/users/AndreSteenveld/following{/other_user}","gists_url":"https://api.github.com/users/AndreSteenveld/gists{/gist_id}","starred_url":"https://api.github.com/users/AndreSteenveld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndreSteenveld/subscriptions","organizations_url":"https://api.github.com/users/AndreSteenveld/orgs","repos_url":"https://api.github.com/users/AndreSteenveld/repos","events_url":"https://api.github.com/users/AndreSteenveld/events{/privacy}","received_events_url":"https://api.github.com/users/AndreSteenveld/received_events","type":"User","site_admin":false},"created_at":"2016-07-24T09:58:30Z","updated_at":"2016-07-24T09:58:30Z","body":"To use babel for migrations, seeders and models I have found that running sequelize with babel works fine. If you run it from your project root it will also pickup your ```.babelrc``` file. \r\n\r\nSteps to make this work:\r\n\r\n1. ```$ npm install --save babel-cli sequelize-cli sequelize <all relevant babel transforms you want to use> <relevant db drivers>```\r\n2. Now it is possible to run the sequelize bin using babel-cli, to init the project you would run: ```$ .node_modules/.bin/babel-node ./node_modules/.bin/sequelize init``` for example.\r\n\r\nFor convienience I've added sequelize, they now look like this:\r\n```\r\n{\r\n  ...\r\n  \"scripts\": {\r\n    \"start\": \"./node_modules/.bin/babel-node $* ./index.js\",\r\n    \"test\": \"./node_modules/.bin/_mocha  --compilers js:./node_modules/babel-register $* ./test/index.js\",\r\n    \"sequelize\": \"./node_modules/.bin/babel-node ./node_modules/.bin/sequelize $*\"\r\n  },\r\n  ...\r\n}\r\n```\r\n\r\nThe ```$*``` makes sure the arguments following the command are placed at the correct position.\r\n\r\nTo make sure this actually worked I've added some import statements and ES6 to my ```.sequelizerc``` file and then ran an init with the following command: ```$ npm run sequelize -- init```"}}
{"actor":{"display_login":"AndreSteenveld"}}