1
0
mirror of https://github.com/home-assistant/frontend.git synced 2025-12-24 12:49:19 +00:00

Redefine browser requirements for modern (latest) builds (#16506)

* Redefine browser requirements for modern (latest) builds

* Rename babel class properties plugin

* Fix only allowing latest Android

* Add browsers released in last year

* Use at or above for utilization (no change to browsers currently)

* Only use time query (no effective change)

* Add transform for private methods

* Fix some typos in browserslist config

Co-authored-by: Quentame <polletquentin74@me.com>

* bump browserslist-useragent-regex

* Add fallback feature detection for Array.prototype.findLast

---------

Co-authored-by: Quentame <polletquentin74@me.com>
This commit is contained in:
Steve Repsher
2024-07-19 10:49:19 -04:00
committed by GitHub
parent d94d5f96c3
commit 345000a0e9
15 changed files with 126 additions and 80 deletions

View File

@@ -140,8 +140,14 @@ module.exports.babelOptions = ({
"@babel/plugin-transform-runtime",
{ version: dependencies["@babel/runtime"] },
],
// Support some proposals still in TC39 process
["@babel/plugin-proposal-decorators", { decoratorsBeforeExport: true }],
// Transpile decorators (still in TC39 process)
// Modern browsers support class fields and private methods, but transform is required with the older decorator version dictated by Lit
[
"@babel/plugin-proposal-decorators",
{ version: "2018-09", decoratorsBeforeExport: true },
],
"@babel/plugin-transform-class-properties",
"@babel/plugin-transform-private-methods",
].filter(Boolean),
exclude: [
// \\ for Windows, / for Mac OS and Linux