mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-24 05:25:08 +01:00
40dd048ace
* Bump js-yaml from 3.14.1 to 4.0.0 Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.14.1 to 4.0.0. - [Release notes](https://github.com/nodeca/js-yaml/releases) - [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md) - [Commits](https://github.com/nodeca/js-yaml/compare/3.14.1...4.0.0) Signed-off-by: dependabot[bot] <support@github.com> * Replace deprecated method Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Yamagishi Kazutoshi <ykzts@desire.sh>
28 lines
749 B
JavaScript
28 lines
749 B
JavaScript
// Common configuration for webpacker loaded from config/webpacker.yml
|
|
|
|
const { resolve } = require('path');
|
|
const { env } = require('process');
|
|
const { load } = require('js-yaml');
|
|
const { readFileSync } = require('fs');
|
|
|
|
const configPath = resolve('config', 'webpacker.yml');
|
|
const settings = load(readFileSync(configPath), 'utf8')[env.RAILS_ENV || env.NODE_ENV];
|
|
|
|
const themePath = resolve('config', 'themes.yml');
|
|
const themes = load(readFileSync(themePath), 'utf8');
|
|
|
|
const output = {
|
|
path: resolve('public', settings.public_output_path),
|
|
publicPath: `/${settings.public_output_path}/`,
|
|
};
|
|
|
|
module.exports = {
|
|
settings,
|
|
themes,
|
|
env: {
|
|
NODE_ENV: env.NODE_ENV,
|
|
PUBLIC_OUTPUT_PATH: settings.public_output_path,
|
|
},
|
|
output,
|
|
};
|