Skip to content

Commit 3dfe480

Browse files
committed
refactor(vivliostyle): reduce scope of environment variable-based branching
1 parent 96bfb01 commit 3dfe480

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

vivliostyle.config.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
11
const TITLE = 'Vivliostyle Base';
22

3+
const pdfOutputDir = process.env.PRESS_ONLY === 'true' ? './dist/press' : './dist/pdf';
34
const pdfConfig = {
4-
path: `./dist/pdf/${TITLE}.pdf`,
5+
path: `${pdfOutputDir}/${TITLE}.pdf`,
56
format: 'pdf',
67
};
78
const webpubConfig = {
89
path: './dist/webpub/',
910
format: 'webpub',
1011
};
1112

12-
const output =
13-
process.env.PRESS_ONLY === 'true' ? [{ ...pdfConfig, path: `./dist/press/${TITLE}.pdf` }] : [pdfConfig, webpubConfig];
14-
1513
module.exports = {
1614
title: TITLE,
1715
author: 'kubosho',
1816
language: 'ja',
1917
size: 'JIS-B5',
2018
theme: '@o2project/vivliostyle-theme-o2project',
2119
entry: ['./entries/introduction.md'],
22-
output,
20+
output: [pdfConfig, webpubConfig],
2321
workspaceDir: '.temp',
2422
toc: {
2523
title: '目次',

0 commit comments

Comments
 (0)