Skip to content

Commit

Permalink
Update webpack environment targets (#4649) (#4672)
Browse files Browse the repository at this point in the history
Also:
* Bump browserslist
* Widen browser support matrix
* Update browser typescript target to ES2018
* Bump `autoprefixer` but remove its usage as it spams the logs about it being unnecessary

Signed-off-by: Miki <[email protected]>
(cherry picked from commit e867585)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent e8949b7 commit c4b2478
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 35 deletions.
15 changes: 10 additions & 5 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
[production]
last 2 Firefox versions
last 2 Chrome versions
last 2 Safari versions
> 0.25%
not ie 11
Firefox > 0 and last 2 years and > 0.01%
Chrome > 0 and last 2 years and > 0.01%
Safari > 0 and last 2 years and > 0.01%
Edge > 0 and last 1 years and > 0.01%
Opera > 0 and last 2 years and > 0.01%
> 0.2%
not op_mini all
not and_uc < 100
not android < 100
not dead

[dev]
last 1 chrome versions
Expand Down
2 changes: 1 addition & 1 deletion packages/osd-babel-preset/node_preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = (_, options = {}) => {
// `nvm install 8 && node ./src/cli` will run OpenSearch Dashboards
// in node version 8 and babel will stop transpiling async/await
// because they are supported in the "current" version of node
node: 'current',
node: 14,
},

// replaces `import "core-js/stable"` with a list of require statements
Expand Down
4 changes: 4 additions & 0 deletions packages/osd-babel-preset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
"babel-plugin-add-module-exports": "^1.0.4",
"babel-plugin-styled-components": "^2.0.2",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"browserslist": "^4.21.10",
"react-is": "^16.8.0",
"styled-components": "^5.3.9"
},
"devDependencies": {
"@types/browserslist": "^4.15.0"
}
}
5 changes: 5 additions & 0 deletions packages/osd-babel-preset/webpack_preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
* under the License.
*/

const { resolve } = require('path');
const browserlist = require('browserslist');
const targets = browserlist.loadConfig({ path: resolve(__dirname, '../..') });

module.exports = () => {
return {
presets: [
Expand All @@ -36,6 +40,7 @@ module.exports = () => {
{
useBuiltIns: 'entry',
modules: false,
targets,
// Please read the explanation for this
// in node_preset.js
corejs: '3.2.1',
Expand Down
4 changes: 3 additions & 1 deletion packages/osd-optimizer/postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,7 @@
*/

module.exports = {
plugins: [require('autoprefixer')()],
plugins: [
/*require('autoprefixer')()*/
],
};

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tsconfig.browser.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"target": "es5",
"target": "es2018",
"module": "esnext",
},
"include": [
Expand Down
Loading

0 comments on commit c4b2478

Please sign in to comment.