Skip to content

Commit

Permalink
fix(loader): trim leading and trailing newlines added by vue-loader
Browse files Browse the repository at this point in the history
  • Loading branch information
Demivan committed Mar 15, 2021
1 parent bbd636c commit 63d71fc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/fluent-vue-loader/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ const loader = function (
}

function generateCode(source: string | Buffer, query: OptionObject): string {
const data = convert(source)
const rawData = convert(source)

// vue-loader pads SFC file sections with newlines - trim those
const data = rawData.replace(/^\n+|\n+$/g, '')

return `
import { FluentResource } from '@fluent/bundle'
Expand Down

0 comments on commit 63d71fc

Please sign in to comment.