Merge upstream 2.0ish #165
This commit is contained in:
		@@ -4,11 +4,7 @@ const env = process.env.NODE_ENV || 'development';
 | 
			
		||||
 | 
			
		||||
module.exports = {
 | 
			
		||||
  test: /\.js$/,
 | 
			
		||||
  // include react-intl because transform-react-remove-prop-types needs to apply to it
 | 
			
		||||
  exclude: {
 | 
			
		||||
    test: /node_modules/,
 | 
			
		||||
    exclude: /react-intl[\/\\](?!locale-data)/,
 | 
			
		||||
  },
 | 
			
		||||
  exclude: /node_modules/,
 | 
			
		||||
  loader: 'babel-loader',
 | 
			
		||||
  options: {
 | 
			
		||||
    forceEnv: process.env.NODE_ENV || 'development',
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										21
									
								
								config/webpack/loaders/babel_external.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								config/webpack/loaders/babel_external.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,21 @@
 | 
			
		||||
const { resolve } = require('path');
 | 
			
		||||
 | 
			
		||||
const env = process.env.NODE_ENV || 'development';
 | 
			
		||||
 | 
			
		||||
if (env === 'development') {
 | 
			
		||||
  module.exports = {};
 | 
			
		||||
} else {
 | 
			
		||||
  // babel options to apply only to external libraries, e.g. remove-prop-types
 | 
			
		||||
  module.exports = {
 | 
			
		||||
    test: /\.js$/,
 | 
			
		||||
    include: /node_modules/,
 | 
			
		||||
    loader: 'babel-loader',
 | 
			
		||||
    options: {
 | 
			
		||||
      babelrc: false,
 | 
			
		||||
      plugins: [
 | 
			
		||||
        'transform-react-remove-prop-types',
 | 
			
		||||
      ],
 | 
			
		||||
      cacheDirectory: env === 'development' ? false : resolve(__dirname, '..', '..', '..', 'tmp', 'cache', 'babel-loader-external'),
 | 
			
		||||
    },
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user