Skip to content

Commit

Permalink
create empty file when no files are added to compiler bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
brainfoolong committed Apr 15, 2024
1 parent 1527479 commit 0ad8781
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions appdata/modules/Framelix/nodejs/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const sass = require('sass')
const cmdParams = JSON.parse((Buffer.from(process.argv[2], 'base64').toString('utf8')))

let fileDataCombined = ''
if (cmdParams.type === 'js' && cmdParams.options.jsStrict && cmdParams.options.compile) {
if (cmdParams.type === 'js' && cmdParams.options.jsStrict && cmdParams.options.compile && cmdParams.files.length) {
fileDataCombined += '\'use strict\';\n\n'
}
for (let i = 0; i < cmdParams.files.length; i++) {
Expand All @@ -24,7 +24,7 @@ for (let i = 0; i < cmdParams.files.length; i++) {
fileDataCombined += fileData
}

if (cmdParams.options.compile) {
if (cmdParams.options.compile && cmdParams.files.length) {
if (cmdParams.type === 'js') {
fileDataCombined = babelCore.transform(fileDataCombined, {
'comments': false,
Expand Down

0 comments on commit 0ad8781

Please sign in to comment.