Saturday 11 March 2017

How do I use Babel with AWS Beanstalk?

I recently started learning about JavaScript and node, and tried making a simple API using Hapi. I installed Babel and it works fine on my machine, but when I try to run it on Beanstalk it doesn't recognize 'import', so I guess Babel isn't working there. I've followed some tutorials, and this is what I made:.babelrc: { "presets": ["es2015"] } package.json:"scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "babel-node bootstrap.js" }, "dependencies": { "babel-core": "^6.23.1", "hapi": "^16.1.0", "joi": "^10.2.2", "pg": "^6.1.3", "pg-hstore": "^2.3.2", "sequelize": "^3.30.2" }, "devDependencies": { "babel-core": "^6.23.1", "babel-preset-env": "^1.2.1", "eslint": "^3.17.1", "eslint-config-airbnb": "^14.1.0", "eslint-config-airbnb-base": "^11.1.1", "eslint-plugin-import": "^2.2.0", "eslint-plugin-jsx-a11y": "^4.0.0", "eslint-plugin-react": "^6.10.0" } bootstrap.js:require( 'babel-core/register' ); require( './src/server'); And the server.js just starts the API, using import. Is there something I'm missing? I don't really know if my dependencies are correct

Submitted March 11, 2017 at 07:46PM by Luke094

No comments:

Post a Comment