chore: modify the babel configuration (#6532)
* chore: modify the babel configuration * fix: 参考 antd-tools 的代码pull/6542/head
							parent
							
								
									045193e797
								
							
						
					
					
						commit
						1deefa8b7f
					
				| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
const { resolve } = require('./utils/projectHelper');
 | 
			
		||||
const { resolve, isThereHaveBrowserslistConfig } = require('./utils/projectHelper');
 | 
			
		||||
 | 
			
		||||
module.exports = function (modules) {
 | 
			
		||||
  const plugins = [
 | 
			
		||||
| 
						 | 
				
			
			@ -38,9 +38,11 @@ module.exports = function (modules) {
 | 
			
		|||
        resolve('@babel/preset-env'),
 | 
			
		||||
        {
 | 
			
		||||
          modules,
 | 
			
		||||
          targets: {
 | 
			
		||||
            browsers: ['last 2 versions', 'Firefox ESR', '> 1%', 'not ie 11'],
 | 
			
		||||
          },
 | 
			
		||||
          targets: isThereHaveBrowserslistConfig()
 | 
			
		||||
            ? undefined
 | 
			
		||||
            : {
 | 
			
		||||
                browsers: ['last 2 versions', 'Firefox ESR', '> 1%', 'ie >= 11'],
 | 
			
		||||
              },
 | 
			
		||||
        },
 | 
			
		||||
      ],
 | 
			
		||||
    ],
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue