Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion scripts/prepublishOnly.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ function processFile(filePath) {
fs.copyFileSync(filePath, backupFilePath)

const source = fs.readFileSync(filePath, 'utf-8')
const newSource = compiler(source, filePath)
const result = compiler(source, filePath)

// Handle both string and object return types
const newSource = typeof result === 'object' && result.code ? result.code : result
fs.writeFileSync(filePath, newSource)

// only format the file if it was changed
Expand Down