Skip to content

Commit e867585

Browse files
authored
Update webpack environment targets (#4649)
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]>
1 parent bf6e887 commit e867585

File tree

9 files changed

+86
-35
lines changed

9 files changed

+86
-35
lines changed

Diff for: .browserslistrc

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
[production]
2-
last 2 Firefox versions
3-
last 2 Chrome versions
4-
last 2 Safari versions
5-
> 0.25%
6-
not ie 11
2+
Firefox > 0 and last 2 years and > 0.01%
3+
Chrome > 0 and last 2 years and > 0.01%
4+
Safari > 0 and last 2 years and > 0.01%
5+
Edge > 0 and last 1 years and > 0.01%
6+
Opera > 0 and last 2 years and > 0.01%
7+
> 0.2%
8+
not op_mini all
9+
not and_uc < 100
10+
not android < 100
11+
not dead
712

813
[dev]
914
last 1 chrome versions

Diff for: CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
4848
- Removes `minimatch` manual resolution ([#3019](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3019))
4949
- 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.
5050
- Bump `js-yaml` from `3.14.0` to `4.1.0` ([#3770](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3770))
51+
- Update webpack environment targets ([#4649](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4649))
5152

5253
### 🪛 Refactoring
5354

Diff for: packages/osd-babel-preset/node_preset.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module.exports = (_, options = {}) => {
4040
// `nvm install 8 && node ./src/cli` will run OpenSearch Dashboards
4141
// in node version 8 and babel will stop transpiling async/await
4242
// because they are supported in the "current" version of node
43-
node: 'current',
43+
node: 14,
4444
},
4545

4646
// replaces `import "core-js/stable"` with a list of require statements

Diff for: packages/osd-babel-preset/package.json

+4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@
1919
"babel-plugin-add-module-exports": "^1.0.4",
2020
"babel-plugin-styled-components": "^2.0.2",
2121
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
22+
"browserslist": "^4.21.10",
2223
"react-is": "^16.8.0",
2324
"styled-components": "^5.3.9"
25+
},
26+
"devDependencies": {
27+
"@types/browserslist": "^4.15.0"
2428
}
2529
}

Diff for: packages/osd-babel-preset/webpack_preset.js

+5
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
* under the License.
2929
*/
3030

31+
const { resolve } = require('path');
32+
const browserlist = require('browserslist');
33+
const targets = browserlist.loadConfig({ path: resolve(__dirname, '../..') });
34+
3135
module.exports = () => {
3236
return {
3337
presets: [
@@ -36,6 +40,7 @@ module.exports = () => {
3640
{
3741
useBuiltIns: 'entry',
3842
modules: false,
43+
targets,
3944
// Please read the explanation for this
4045
// in node_preset.js
4146
corejs: '3.2.1',

Diff for: packages/osd-optimizer/postcss.config.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,7 @@
2929
*/
3030

3131
module.exports = {
32-
plugins: [require('autoprefixer')()],
32+
plugins: [
33+
/*require('autoprefixer')()*/
34+
],
3335
};

Diff for: packages/osd-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: tsconfig.browser.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "./tsconfig.base.json",
33
"compilerOptions": {
4-
"target": "es5",
4+
"target": "es2018",
55
"module": "esnext",
66
},
77
"include": [

0 commit comments

Comments
 (0)