From aa821b7024f5614376d4d41dc3db83680488281c Mon Sep 17 00:00:00 2001 From: Stephen Edgar Date: Thu, 1 Feb 2018 12:57:26 +1100 Subject: [PATCH] build: use `browserslist-config-wordpress` Browserslist shared config (#68) * build: use `browserslist-config-wordpress` Browserslist shared config * chore(babel-preset-default): switch to `@wordpress/browserslist-config` * chore: fix merge conflict * chore: regenerate `package-lock.json` * Browserslit config: Add devDependency in the root repository * Babel preset default: Add missing spaces around square brackets --- package-lock.json | 6 ++++++ package.json | 1 + packages/babel-preset-default/index.js | 13 +------------ packages/babel-preset-default/package-lock.json | 7 ++++++- packages/babel-preset-default/package.json | 1 + 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 888a7994d9f660..9f3067138cf111 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2,6 +2,12 @@ "requires": true, "lockfileVersion": 1, "dependencies": { + "@wordpress/browserslist-config": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/browserslist-config/-/browserslist-config-2.0.0.tgz", + "integrity": "sha512-05lxYDJ9snDc9x5Ljs7KZpnixrxtUL7TZgoLiNdxLYqIarSa/2m/1PB6tEaYoARyB/NhpJCaf/caYihPsRTM1A==", + "dev": true + }, "JSONStream": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.2.tgz", diff --git a/package.json b/package.json index 5b499d457c8454..39982bf9e2b6c3 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "npm": ">=5.0.0" }, "devDependencies": { + "@wordpress/browserslist-config": "^2.0.0", "babel-core": "^6.26.0", "chalk": "^2.0.1", "check-node-version": "^3.1.1", diff --git a/packages/babel-preset-default/index.js b/packages/babel-preset-default/index.js index 5484cd0423b994..70f32f33108f71 100644 --- a/packages/babel-preset-default/index.js +++ b/packages/babel-preset-default/index.js @@ -6,18 +6,7 @@ module.exports = { ! isTestEnv && [ require( 'babel-preset-env' ), { modules: false, targets: { - browsers: [ - 'last 2 Chrome versions', - 'last 2 Firefox versions', - 'last 2 Safari versions', - 'last 2 Edge versions', - 'last 2 Opera versions', - 'last 2 iOS versions', - 'last 1 Android version', - 'last 1 ChromeAndroid version', - 'ie 11', - '> 1%', - ], + browsers: [ 'extends @wordpress/browserslist-config' ], }, } ], isTestEnv && [ require( 'babel-preset-env' ) ], diff --git a/packages/babel-preset-default/package-lock.json b/packages/babel-preset-default/package-lock.json index b93a5fbca14d11..86788bebbd7c99 100644 --- a/packages/babel-preset-default/package-lock.json +++ b/packages/babel-preset-default/package-lock.json @@ -1,9 +1,14 @@ { "name": "@wordpress/babel-preset-default", - "version": "1.0.0", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { + "@wordpress/browserslist-config": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/browserslist-config/-/browserslist-config-2.0.0.tgz", + "integrity": "sha512-05lxYDJ9snDc9x5Ljs7KZpnixrxtUL7TZgoLiNdxLYqIarSa/2m/1PB6tEaYoARyB/NhpJCaf/caYihPsRTM1A==" + }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", diff --git a/packages/babel-preset-default/package.json b/packages/babel-preset-default/package.json index fc4bc975d2d4cb..2331517f1b359e 100644 --- a/packages/babel-preset-default/package.json +++ b/packages/babel-preset-default/package.json @@ -22,6 +22,7 @@ "node": ">=8" }, "dependencies": { + "@wordpress/browserslist-config": "^2.0.0", "babel-plugin-lodash": "^3.3.2", "babel-plugin-transform-object-rest-spread": "^6.23.0", "babel-plugin-transform-react-jsx": "^6.24.1",