~cytrogen/masto-fe

ref: 02106153ecbe3de078a3dc3bea5a13775bb87cc5 masto-fe/config/webpack/rules/babel.js -rw-r--r-- 573 bytes
02106153 — prplecake [feature] Re-enable auto-unfold CW setting (#46) 11 months ago
                                                                                
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, resolve } = require('path');

const { env, settings } = require('../configuration');

module.exports = {
  test: /\.(js|jsx|mjs|ts|tsx)$/,
  include: [
    settings.source_path,
    ...settings.resolved_paths,
  ].map(p => resolve(p)),
  exclude: /node_modules/,
  use: [
    {
      loader: 'babel-loader',
      options: {
        sourceRoot: 'app/javascript',
        cacheDirectory: join(settings.cache_path, 'babel-loader'),
        cacheCompression: env.NODE_ENV === 'production',
        compact: env.NODE_ENV === 'production',
      },
    },
  ],
};