Skip to content

Commit 63d71fc

Browse files
committed
fix(loader): trim leading and trailing newlines added by vue-loader
1 parent bbd636c commit 63d71fc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/fluent-vue-loader/src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ const loader = function (
2222
}
2323

2424
function generateCode(source: string | Buffer, query: OptionObject): string {
25-
const data = convert(source)
25+
const rawData = convert(source)
26+
27+
// vue-loader pads SFC file sections with newlines - trim those
28+
const data = rawData.replace(/^\n+|\n+$/g, '')
2629

2730
return `
2831
import { FluentResource } from '@fluent/bundle'

0 commit comments

Comments
 (0)