about summary refs log tree commit diff
path: root/config/webpack/rules/node_modules.js
blob: 5debc1b5d124a149f44ee4cfdfd4428ffbed1b5e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const { join } = require('path');
const { settings, env } = require('../configuration');

module.exports = {
  test: /\.(js|mjs)$/,
  include: /node_modules/,
  exclude: /@babel(?:\/|\\{1,2})runtime/,
  use: [
    {
      loader: 'babel-loader',
      options: {
        babelrc: false,
        plugins: [
          [
            'transform-react-remove-prop-types',
            {
              mode: 'remove',
              removeImport: true,
              additionalLibraries: [
                '../../utils/shared-props', // emoji-mart
              ],
            },
          ],
        ],
        cacheDirectory: join(settings.cache_path, 'babel-loader-node-modules'),
        cacheCompression: env.NODE_ENV === 'production',
        compact: false,
        sourceMaps: false,
      },
    },
  ],
};