diff --git a/.browserslistrc b/.browserslistrc index 04395b913c9c..d4d73efce5a4 100644 --- a/.browserslistrc +++ b/.browserslistrc @@ -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 year and > 0.01% +Opera > 0 and last 2 year and > 0.01% +> 0.2% +not op_mini all +not and_uc < 100 +not android < 100 +not dead [dev] last 1 chrome versions diff --git a/CHANGELOG.md b/CHANGELOG.md index cb4238ffd5b4..da841db5b4c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Removes `minimatch` manual resolution ([#3019](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3019)) - Upgrade `vega-lite` dependency from `4.17.0` to `^5.6.0` ([#3076](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3076)). Backwards-compatible version included in v2.5.0 release. - Bump `js-yaml` from `3.14.0` to `4.1.0` ([#3770](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3770)) +- Update webpack environment targets ([#4649](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4649)) ### 🪛 Refactoring diff --git a/packages/osd-babel-preset/node_preset.js b/packages/osd-babel-preset/node_preset.js index 0acb1e146bdd..43915e239c38 100644 --- a/packages/osd-babel-preset/node_preset.js +++ b/packages/osd-babel-preset/node_preset.js @@ -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 diff --git a/packages/osd-babel-preset/webpack_preset.js b/packages/osd-babel-preset/webpack_preset.js index d1ee5c3cb19a..8497a5ec577c 100644 --- a/packages/osd-babel-preset/webpack_preset.js +++ b/packages/osd-babel-preset/webpack_preset.js @@ -36,6 +36,18 @@ module.exports = () => { { useBuiltIns: 'entry', modules: false, + targets: [ + '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', + ], // Please read the explanation for this // in node_preset.js corejs: '3.2.1', diff --git a/packages/osd-optimizer/postcss.config.js b/packages/osd-optimizer/postcss.config.js index 5b8b2e731989..2b1e3a8694ed 100644 --- a/packages/osd-optimizer/postcss.config.js +++ b/packages/osd-optimizer/postcss.config.js @@ -29,5 +29,7 @@ */ module.exports = { - plugins: [require('autoprefixer')()], + plugins: [ + /*require('autoprefixer')()*/ + ], }; diff --git a/packages/osd-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap b/packages/osd-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap index a13a8178b6ca..b08793cdae2f 100644 --- a/packages/osd-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap +++ b/packages/osd-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap @@ -80,4 +80,4 @@ exports[`prepares assets for distribution: bar bundle 1`] = `"(function(modules) exports[`prepares assets for distribution: foo async bundle 1`] = `"(window[\\"foo_bundle_jsonpfunction\\"]=window[\\"foo_bundle_jsonpfunction\\"]||[]).push([[1],{3:function(module,__webpack_exports__,__webpack_require__){\\"use strict\\";__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,\\"foo\\",(function(){return foo}));function foo(){}}}]);"`; -exports[`prepares assets for distribution: foo bundle 1`] = `"(function(modules){function webpackJsonpCallback(data){var chunkIds=data[0];var moreModules=data[1];var moduleId,chunkId,i=0,resolves=[];for(;i