bigbuffet-rw/webpack/configuration.ts

33 lines
797 B
TypeScript
Raw Normal View History

import { join } from 'path';
import { env } from 'process';
2020-03-27 13:59:38 -07:00
const {
2021-09-05 11:21:39 -07:00
FE_SUBDIRECTORY,
FE_BUILD_DIR,
2022-11-16 05:32:32 -08:00
} = require(join(__dirname, '..', 'app', 'soapbox', 'build-config'));
2021-09-03 09:50:39 -07:00
2020-10-08 07:43:00 -07:00
const settings = {
source_path: 'app',
public_root_path: FE_BUILD_DIR,
test_root_path: `${FE_BUILD_DIR}-test`,
2021-09-05 14:42:48 -07:00
cache_path: 'tmp/cache',
2020-10-08 07:43:00 -07:00
resolved_paths: [],
extensions: [ '.mjs', '.js', '.jsx', '.ts', '.tsx', '.sass', '.scss', '.css', '.module.sass', '.module.scss', '.module.css', '.png', '.svg', '.gif', '.jpeg', '.jpg' ],
2020-10-08 07:43:00 -07:00
};
2020-03-27 13:59:38 -07:00
const outputDir = env.NODE_ENV === 'test' ? settings.test_root_path : settings.public_root_path;
2020-10-08 07:43:00 -07:00
const output = {
2021-09-05 11:21:39 -07:00
path: join(__dirname, '..', outputDir, FE_SUBDIRECTORY),
};
2020-03-27 13:59:38 -07:00
const exportEnv = {
NODE_ENV: env.NODE_ENV,
};
export {
2020-03-27 13:59:38 -07:00
settings,
exportEnv as env,
output,
2020-03-27 13:59:38 -07:00
};