mirror of
https://github.com/grafana/grafana.git
synced 2025-09-18 05:02:51 +08:00
Babel: Refactoring config so that it's shared and removes legacy plugin (#32559)
* Updated plugins * Fixing stuff * Update * Fixing more stuff
This commit is contained in:
@ -8,6 +8,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
||||
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
const getBabelConfig = require('./babel.config');
|
||||
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
||||
|
||||
module.exports = (env = {}) =>
|
||||
@ -35,43 +36,7 @@ module.exports = (env = {}) =>
|
||||
use: [
|
||||
{
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
cacheDirectory: true,
|
||||
babelrc: false,
|
||||
// Note: order is top-to-bottom and/or left-to-right
|
||||
plugins: [
|
||||
[
|
||||
require('@rtsao/plugin-proposal-class-properties'),
|
||||
{
|
||||
loose: true,
|
||||
},
|
||||
],
|
||||
'@babel/plugin-proposal-nullish-coalescing-operator',
|
||||
'@babel/plugin-proposal-optional-chaining',
|
||||
'angularjs-annotate',
|
||||
],
|
||||
// Note: order is bottom-to-top and/or right-to-left
|
||||
presets: [
|
||||
[
|
||||
'@babel/preset-env',
|
||||
{
|
||||
targets: {
|
||||
browsers: 'last 3 versions',
|
||||
},
|
||||
useBuiltIns: 'entry',
|
||||
corejs: 3,
|
||||
modules: false,
|
||||
},
|
||||
],
|
||||
[
|
||||
'@babel/preset-typescript',
|
||||
{
|
||||
allowNamespaces: true,
|
||||
},
|
||||
],
|
||||
'@babel/preset-react',
|
||||
],
|
||||
},
|
||||
options: getBabelConfig(),
|
||||
},
|
||||
],
|
||||
},
|
||||
|
Reference in New Issue
Block a user