Skip to content

Commit

Permalink
fix(okam-build): pad script file content when script exists
Browse files Browse the repository at this point in the history
  • Loading branch information
wuhy committed Nov 1, 2018
1 parent 73382ca commit 85a8286
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/okam-build/lib/processor/component/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ function parse(file, options) {
initPartFileInfo(file, tplFile, scriptFile, styleFiles);

// fix pad line missing when lang is set in script part
scriptFile.content = scriptFile.content.replace(
/^\n+/, match => match.replace(/\n/g, '//\n')
);
if (scriptFile) {
scriptFile.content = scriptFile.content.replace(
/^\n+/, match => match.replace(/\n/g, '//\n')
);
}

return {
isComponent: true,
Expand Down

0 comments on commit 85a8286

Please sign in to comment.