soapbox/webpack/rules/babel-git.ts

24 wiersze
582 B
TypeScript
Czysty Zwykły widok Historia

2022-10-14 20:43:32 +00:00
import { resolve } from 'path';
2022-10-14 20:43:32 +00:00
import { env } from '../configuration';
import type { RuleSetRule } from 'webpack';
2021-03-30 20:24:02 +00:00
2021-03-30 20:40:58 +00:00
// This is a hack, used in conjunction with rules/git-refresh.js
// https://github.com/kentcdodds/babel-plugin-preval/issues/19
2022-10-14 20:43:32 +00:00
const rule: RuleSetRule = {
2021-03-30 20:24:02 +00:00
test: resolve(__dirname, '../../app/soapbox/utils/code.js'),
use: [
{
loader: 'babel-loader',
options: {
cacheDirectory: false,
cacheCompression: env.NODE_ENV === 'production',
compact: env.NODE_ENV === 'production',
},
},
],
};
2022-10-14 20:43:32 +00:00
export default rule;