about summary refs log tree commit diff
path: root/config/webpack/rules/node_modules.js
blob: 7ed05504bf3d29fcdfccaab9171031b61da2d111 (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
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',
        ],
        cacheDirectory: join(settings.cache_path, 'babel-loader-node-modules'),
        cacheCompression: env.NODE_ENV === 'production',
        compact: false,
        sourceMaps: false,
      },
    },
  ],
};