Skip to content
Snippets Groups Projects
Commit bebaa6ec authored by Nolan Lawson's avatar Nolan Lawson Committed by Eugen Rochko
Browse files

Remove prop types from external libraries (#5304)

parent 616f53ee
No related branches found
No related tags found
No related merge requests found
......@@ -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: env,
......
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'),
},
};
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment