mirror of
https://github.com/grafana/grafana.git
synced 2025-08-01 05:11:50 +08:00
Replace ts-loader with Babel (#21587)
* Applied prettier to relevant webpack configs * Replaced ng-annotate with babel-plugin-angularjs-annotate … and replaced ts-loader with @preset/typescript * Removed redundant import … that is problematic with Babel's module resolver * Updated lockfile * Traspile debug package to es5 for PhantomJS support * Update babel to latest version * Remove @babel/poolyfill and url search params polyfill * Add ts-loader to grafana-ui dependencies * Update prod webpack build to use cor-js 3 * Applied prettier to relevant webpack configs * Replaced ng-annotate with babel-plugin-angularjs-annotate … and replaced ts-loader with @preset/typescript * Updated lockfile Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
This commit is contained in:
@ -2,7 +2,7 @@ const path = require('path');
|
||||
|
||||
// https://github.com/visionmedia/debug/issues/701#issuecomment-505487361
|
||||
function shouldExclude(filename) {
|
||||
const packagesToProcessbyBabel = ['debug', 'lru-cache', 'yallist', 'apache-arrow', 'react-hook-form'];
|
||||
const packagesToProcessbyBabel = ['debug', 'lru-cache', 'yallist', 'apache-arrow', 'react-hook-form', 'rc-trigger'];
|
||||
for (const package of packagesToProcessbyBabel) {
|
||||
if (filename.indexOf(`node_modules/${package}`) > 0) {
|
||||
return false;
|
||||
@ -11,6 +11,7 @@ function shouldExclude(filename) {
|
||||
return true;
|
||||
}
|
||||
|
||||
console.log(path.resolve());
|
||||
module.exports = {
|
||||
target: 'web',
|
||||
entry: {
|
||||
@ -24,7 +25,11 @@ module.exports = {
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.ts', '.tsx', '.es6', '.js', '.json', '.svg'],
|
||||
alias: {},
|
||||
alias: {
|
||||
// rc-trigger uses babel-runtime which has internal dependency to core-js@2
|
||||
// this alias maps that dependency to core-js@t3
|
||||
'core-js/library/fn': 'core-js/stable',
|
||||
},
|
||||
modules: [path.resolve('public'), path.resolve('node_modules')],
|
||||
},
|
||||
stats: {
|
||||
|
Reference in New Issue
Block a user