chore!: use google browserlist config

This commit is contained in:
arthurfiorette 2021-12-09 17:13:18 -03:00
parent 32afef4ae8
commit 1fc35529fa
No known key found for this signature in database
GPG Key ID: 9D190CD53C53C555
5 changed files with 21 additions and 4 deletions

View File

@ -1,6 +1,9 @@
// Config ignored by babel when running from webpack
{
"presets": ["@babel/preset-env", "@babel/preset-typescript"],
"presets": [
["@babel/preset-env", { "targets": "extends browserslist-config-google" }],
"@babel/preset-typescript"
],
"plugins": ["@babel/plugin-transform-runtime"],
"comments": false,
"compact": true,

View File

@ -211,14 +211,19 @@ After that, you can made your own requests normally.
## Compiled code
The compiled code is built with Babel for npm and Webpack & Babel for the web bundle.
The compiled code is built in two different ways, one as nodejs module and one as a
browser. Both of them uses **Babel** with
[Browserslist `default` preset](https://github.com/browserslist/browserslist#full-list).
You can see more here about compiling options:
- [Webpack config](/webpack.config.js)
- [Babel Config](/babel.config.js)
- [Babel Config](/.babelrc)
- [Types Config](/tsconfig.types.json)
If, for some reason, you have a bug with the compiled code, such as a user have an
incompatible browser, please contact me.
<br />
## Basic Knowledge

View File

@ -62,6 +62,7 @@
"auto-changelog": "^2.3.0",
"axios": "~0.24.0",
"babel-loader": "^8.2.3",
"browserslist-config-google": "^3.0.1",
"concurrently": "^6.4.0",
"eslint": "^8.3.0",
"eslint-config-prettier": "^8.3.0",

View File

@ -37,7 +37,10 @@ const config = {
loader: 'babel-loader',
options: {
babelrc: false,
presets: ['@babel/preset-env', '@babel/preset-typescript'],
presets: [
['@babel/preset-env', { targets: 'extends browserslist-config-google' }],
'@babel/preset-typescript'
],
plugins: [
'@babel/plugin-transform-runtime',
'@babel/plugin-transform-modules-commonjs'

View File

@ -1869,6 +1869,11 @@ browser-process-hrtime@^1.0.0:
resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626"
integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==
browserslist-config-google@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/browserslist-config-google/-/browserslist-config-google-3.0.1.tgz#7d78e87e049da92a5e7180438d755f8dd76100c8"
integrity sha512-987cIZMlj4zmA/kuMmSl4yJpJLEPTn1MhToBrnvnzdjLziW4cTbVK02SA3Omz/B1eE+pVjDUngR1FmjPEFRm1w==
browserslist@^4.14.5, browserslist@^4.17.5, browserslist@^4.18.1:
version "4.18.1"
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.18.1.tgz#60d3920f25b6860eb917c6c7b185576f4d8b017f"