Skip to content

Commit

Permalink
fix: import order
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanSalt committed Apr 27, 2024
1 parent be05cfd commit c4178b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,9 @@ function getLastImports(ast: Program) {
export function prependStatements(ast: Program, magicString: MagicStringAST, code: string[]) {
const lastImports = getLastImports(ast)
if (lastImports) {
magicString.appendLeft(lastImports.end!, code.map(statement => `\n\n${statement}`).join(''))
magicString.prependRight(lastImports.end!, code.map(statement => `\n\n${statement}`).join(''))
} else {
magicString.appendLeft(0, code.map(statement => `${statement}\n\n`).join(''))
magicString.prependRight(0, code.map(statement => `${statement}\n\n`).join(''))
}
}

Expand Down

0 comments on commit c4178b6

Please sign in to comment.