Skip to content

Commit 92d7056

Browse files
authored
Merge pull request #1736 from StoDevX/minify-data-files
Minify data files
2 parents d37dad1 + 36d54c1 commit 92d7056

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

scripts/bundle-data-dir.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function bundleDataDir({fromDir, toFile}) {
3838
return yaml.safeLoad(contents)
3939
})
4040
const dated = {data: loaded}
41-
const output = JSON.stringify(dated, null, 2) + '\n'
41+
const output = JSON.stringify(dated) + '\n'
4242

4343
const outStream =
4444
toFile === '-' ? process.stdout : fs.createWriteStream(toFile)

scripts/convert-data-file.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ function convertDataFile({fromFile, toFile, toFileType = 'json'}) {
5353

5454
function processYaml(fileContents) {
5555
let loaded = yaml.safeLoad(fileContents)
56-
return JSON.stringify({data: loaded}, null, 2)
56+
return JSON.stringify({data: loaded})
5757
}
5858

5959
function processMarkdown(fileContents) {
60-
return JSON.stringify({text: fileContents}, null, 2)
60+
return JSON.stringify({text: fileContents})
6161
}
6262

6363
function processCSS(fileContents) {
64-
return JSON.stringify({css: fileContents}, null, 2)
64+
return JSON.stringify({css: fileContents})
6565
}

0 commit comments

Comments
 (0)