From f56a807792c55a4c675bdccd0f556d9128c50efb Mon Sep 17 00:00:00 2001 From: Juan Tejada Date: Sat, 28 Jan 2017 01:58:52 -0800 Subject: [PATCH] [cloud-*] Fix n1-cloud build We added new presets and plugins to the k2 .babelrc but didn't add the respective dependencies in our package.json, so the build was failing. Add the required dependencies, and make sure that `build-n1-cloud.js` uses the correct babel presets and plugins --- package.json | 19 +++++++++---------- scripts/build-n1-cloud.js | 3 ++- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index bfb55bdb3..6bc721600 100644 --- a/package.json +++ b/package.json @@ -3,24 +3,23 @@ "version": "0.0.2", "description": "The local sync engine for Nylas Mail", "main": "", - "dependencies": { - "babel-cli": "6.18.0", - "babel-core": "6.20.0", - "babel-preset-electron": "^0.37.8", - "fs-extra": "1.0.0", - "glob": "7.1.1", - "lerna": "2.0.0-beta.30", - "pm2": "^1.1.3" - }, "devDependencies": { "babel-eslint": "7.1.0", "babel-cli": "6.22.2", + "babel-core": "6.20.0", + "babel-plugin-transform-async-generator-functions": "6.17.0", + "babel-preset-electron": "^0.37.8", + "babel-preset-react": "6.16.0", "eslint": "3.10.2", "eslint_d": "4.2.0", "eslint-config-airbnb": "13.0.0", "eslint-plugin-import": "2.2.0", "eslint-plugin-jsx-a11y": "2.2.3", - "eslint-plugin-react": "6.7.1" + "eslint-plugin-react": "6.7.1", + "fs-extra": "1.0.0", + "glob": "7.1.1", + "lerna": "2.0.0-beta.30", + "pm2": "1.1.3" }, "scripts": { "start": "pm2 stop all; pm2 delete all; pm2 start ./pm2-dev.yml --no-daemon", diff --git a/scripts/build-n1-cloud.js b/scripts/build-n1-cloud.js index bde410131..08d8499e9 100644 --- a/scripts/build-n1-cloud.js +++ b/scripts/build-n1-cloud.js @@ -16,7 +16,8 @@ glob.sync("n1_cloud_dist/**/*.es6", {absolute: true}).forEach((es6Path) => { console.log(`---> Compiling ${es6Path.slice(es6Path.indexOf("/n1_cloud_dist") + 15)}`) const res = babel.transformFileSync(es6Path, { - presets: ["electron"], + presets: ["electron", "react"], + plugins: ["transform-async-generator-functions"], sourceMaps: true, sourceRoot: '/', sourceMapTarget: path.relative("n1_cloud_dist/", outPath),