bigbuffet-rw/webpack/rules/babel-build-config.ts

25 lines
587 B
TypeScript
Raw Normal View History

2022-10-14 13:43:32 -07:00
import { resolve } from 'path';
2022-10-14 13:43:32 -07:00
import { env } from '../configuration';
import type { RuleSetRule } from 'webpack';
2022-11-16 05:32:32 -08:00
// This is a hack, used to force build-config @preval to recompile
// https://github.com/kentcdodds/babel-plugin-preval/issues/19
2022-10-14 13:43:32 -07:00
const rule: RuleSetRule = {
2022-11-16 05:32:32 -08:00
test: resolve(__dirname, '../../app/soapbox/build-config.js'),
use: [
{
loader: 'babel-loader',
options: {
cacheDirectory: false,
cacheCompression: env.NODE_ENV === 'production',
compact: env.NODE_ENV === 'production',
},
},
],
};
2022-10-14 13:43:32 -07:00
export default rule;