logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

babel_external.js (582B)


  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. }