Babel: Target more modern browsers, updates browserlistrc (#32573)

* Babel: Target more modern browsers, updates browserlistrc

* Updates

* Fixed circular dependencies, grafana booted
This commit is contained in:
Torkel Ödegaard
2021-04-01 10:32:00 +02:00
committed by GitHub
parent ee06970d72
commit 7f6229494d
31 changed files with 99 additions and 90 deletions
+4 -6
View File
@@ -1,4 +1,4 @@
module.exports = function getBabelConfig() {
module.exports = function getBabelConfig(options = {}) {
return {
cacheDirectory: true,
babelrc: false,
@@ -8,12 +8,10 @@ module.exports = function getBabelConfig() {
[
'@babel/preset-env',
{
targets: {
browsers: 'last 3 versions',
},
bugfixes: true,
browserslistEnv: process.env.BABEL_ENV || options.BABEL_ENV || 'production',
useBuiltIns: 'entry',
corejs: 3,
modules: false,
corejs: '3.10',
},
],
[
+2 -3
View File
@@ -1,6 +1,7 @@
const path = require('path');
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
const getBabelConfig = require('./babel.config');
// https://github.com/visionmedia/debug/issues/701#issuecomment-505487361
function shouldExclude(filename) {
@@ -129,9 +130,7 @@ module.exports = {
use: [
{
loader: 'babel-loader',
options: {
presets: [['@babel/preset-env']],
},
options: getBabelConfig(),
},
],
},
+1 -1
View File
@@ -36,7 +36,7 @@ module.exports = (env = {}) =>
use: [
{
loader: 'babel-loader',
options: getBabelConfig(),
options: getBabelConfig({ BABEL_ENV: 'dev' }),
},
],
},