soapbox/webpack/configuration.js

31 lines
789 B
JavaScript
Raw Normal View History

2020-03-27 19:35:00 -05:00
const { join } = require('path');
2020-03-27 15:59:38 -05:00
const { env } = require('process');
const {
2021-09-05 13:21:39 -05:00
FE_SUBDIRECTORY,
FE_BUILD_DIR,
} = require(join(__dirname, '..', 'app', 'soapbox', 'build_config'));
2021-09-03 11:50:39 -05:00
2020-10-08 08:43:00 -06:00
const settings = {
source_path: 'app',
public_root_path: FE_BUILD_DIR,
test_root_path: `${FE_BUILD_DIR}-test`,
2021-09-05 16:42:48 -05:00
cache_path: 'tmp/cache',
2020-10-08 08:43:00 -06: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 08:43:00 -06:00
};
2020-03-27 15:59:38 -05:00
const outputDir = env.NODE_ENV === 'test' ? settings.test_root_path : settings.public_root_path;
2020-10-08 08:43:00 -06:00
const output = {
2021-09-05 13:21:39 -05:00
path: join(__dirname, '..', outputDir, FE_SUBDIRECTORY),
};
2020-03-27 15:59:38 -05:00
module.exports = {
settings,
env: {
NODE_ENV: env.NODE_ENV,
},
output,
2020-03-27 15:59:38 -05:00
};