soapbox/webpack/configuration.js

29 wiersze
895 B
JavaScript
Czysty Zwykły widok Historia

2020-03-28 00:35:00 +00:00
const { join } = require('path');
2020-03-27 20:59:38 +00:00
const { env } = require('process');
2021-09-03 16:50:39 +00:00
const { FE_BASE_PATH } = require(join(__dirname, '..', 'app', 'soapbox', 'build_config'));
2020-10-08 14:43:00 +00:00
const settings = {
source_path: 'app',
public_root_path: 'static',
test_root_path: 'static-test',
2020-10-08 14:43:00 +00:00
cache_path: 'tmp/cache/webpacker',
resolved_paths: [],
static_assets_extensions: [ '.jpg', '.jpeg', '.png', '.tiff', '.ico', '.svg', '.gif', '.eot', '.otf', '.ttf', '.woff', '.woff2', '.mp3', '.ogg', '.oga' ],
2020-10-08 14:43:00 +00:00
extensions: [ '.mjs', '.js', '.sass', '.scss', '.css', '.module.sass', '.module.scss', '.module.css', '.png', '.svg', '.gif', '.jpeg', '.jpg' ],
};
2020-03-27 20:59:38 +00:00
const outputDir = env.NODE_ENV === 'test' ? settings.test_root_path : settings.public_root_path;
2020-10-08 14:43:00 +00:00
const output = {
2021-09-03 16:50:39 +00:00
path: join(__dirname, '..', outputDir, FE_BASE_PATH),
};
2020-03-27 20:59:38 +00:00
module.exports = {
settings,
env: {
NODE_ENV: env.NODE_ENV,
},
output,
2020-03-27 20:59:38 +00:00
};