From 35bdcfadf5e68373e8537cf35b93e89c11ee14bb Mon Sep 17 00:00:00 2001 From: Mael Date: Mon, 10 Sep 2018 17:09:25 +0200 Subject: [PATCH] Ajout de l'optional chaining https://babeljs.io/docs/en/next/babel-plugin-proposal-optional-chaining.html#options --- package.json | 4 ++-- source/.babelrc | 1 + yarn.lock | 13 +++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index cb67fd9da..4be486c77 100644 --- a/package.json +++ b/package.json @@ -53,13 +53,12 @@ }, "scripts": { "compile": "webpack --config source/webpack.prod.js", - "serve:embauche": "webpack --config source/webpack.prod.js; cp dist/embauche.html dist/404.html; http-server dist &", + "serve:embauche": "cp dist/embauche.html dist/index.html && serve -s dist", "eslint-check": "eslint --print-config .eslintrc | eslint-config-prettier-check", "eslint": "LIST=`git diff --cached --name-only --diff-filter=AMR HEAD | grep .*\\.js | grep -v json`; if [ \"$LIST\" ]; then eslint $LIST; fi", "externalize": "node source/externalize.js", "heroku-postbuild": "yarn install --production=false && yarn compile", "prepare": "flow-typed update-cache", - "serve:embauche": "cp dist/embauche.html dist/index.html && serve -s dist", "serve:infrance": "cp dist/infrance.html dist/index.html && serve -s dist", "pretest": "LIST=`git diff --name-only --diff-filter=AMR HEAD^..HEAD | grep .*\\.js | grep -v json`; if [ \"$LIST\" ]; then eslint $LIST; fi && flow check", "start": "webpack-serve ./source/webpack.dev.js", @@ -75,6 +74,7 @@ "@babel/core": "=7.0.0-beta.51", "@babel/plugin-proposal-decorators": "=7.0.0-beta.51", "@babel/plugin-proposal-object-rest-spread": "=7.0.0-beta.51", + "@babel/plugin-proposal-optional-chaining": "^7.0.0", "@babel/plugin-syntax-decorators": "=7.0.0-beta.51", "@babel/polyfill": "=7.0.0-beta.51", "@babel/preset-env": "=7.0.0-beta.51", diff --git a/source/.babelrc b/source/.babelrc index 192f4da05..806b13c79 100644 --- a/source/.babelrc +++ b/source/.babelrc @@ -15,6 +15,7 @@ "plugins": [ ["@babel/plugin-proposal-decorators", { "legacy": true }], "transform-do-expressions", + "@babel/plugin-proposal-optional-chaining", "@babel/plugin-proposal-object-rest-spread", "transform-class-properties", "syntax-dynamic-import", diff --git a/yarn.lock b/yarn.lock index d7581d1fb..bb9bcc24d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -294,6 +294,13 @@ "@babel/helper-plugin-utils" "7.0.0-beta.51" "@babel/plugin-syntax-optional-catch-binding" "7.0.0-beta.51" +"@babel/plugin-proposal-optional-chaining@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.0.0.tgz#3d344d4152253379b8758e7d041148e8787c4a9d" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-optional-chaining" "^7.0.0" + "@babel/plugin-proposal-unicode-property-regex@7.0.0-beta.51": version "7.0.0-beta.51" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.0.0-beta.51.tgz#d296c3ea74ca37fd7fa55bbf8c0cd85aa7d99f7b" @@ -338,6 +345,12 @@ dependencies: "@babel/helper-plugin-utils" "7.0.0-beta.51" +"@babel/plugin-syntax-optional-chaining@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.0.0.tgz#1e6ecba124310b5d3a8fc1e00d50b1c4c2e05e68" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-transform-arrow-functions@7.0.0-beta.51": version "7.0.0-beta.51" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.0.0-beta.51.tgz#29b9db6e38688a06ec5c25639996d89a5ebfdbe3"