闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
582 B

  1. const { resolve } = require('path');
  2. const env = process.env.NODE_ENV || 'development';
  3. if (env === 'development') {
  4. module.exports = {};
  5. } else {
  6. // babel options to apply only to external libraries, e.g. remove-prop-types
  7. module.exports = {
  8. test: /\.js$/,
  9. include: /node_modules/,
  10. loader: 'babel-loader',
  11. options: {
  12. babelrc: false,
  13. plugins: [
  14. 'transform-react-remove-prop-types',
  15. ],
  16. cacheDirectory: env === 'development' ? false : resolve(__dirname, '..', '..', '..', 'tmp', 'cache', 'babel-loader-external'),
  17. },
  18. };
  19. }