闭社主体 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.

32 lines
808 B

  1. const { join } = require('path');
  2. const { settings, env } = require('../configuration');
  3. module.exports = {
  4. test: /\.(js|mjs)$/,
  5. include: /node_modules/,
  6. exclude: /@babel(?:\/|\\{1,2})runtime/,
  7. use: [
  8. {
  9. loader: 'babel-loader',
  10. options: {
  11. babelrc: false,
  12. plugins: [
  13. [
  14. 'transform-react-remove-prop-types',
  15. {
  16. mode: 'remove',
  17. removeImport: true,
  18. additionalLibraries: [
  19. '../../utils/shared-props', // emoji-mart
  20. ],
  21. },
  22. ],
  23. ],
  24. cacheDirectory: join(settings.cache_path, 'babel-loader-node-modules'),
  25. cacheCompression: env.NODE_ENV === 'production',
  26. compact: false,
  27. sourceMaps: false,
  28. },
  29. },
  30. ],
  31. };