Skip to content

Commit

Permalink
feat: respect vite configuration when generating output code
Browse files Browse the repository at this point in the history
Makes #55 configurable by the user
  • Loading branch information
JonasKruckenberg committed Apr 9, 2021
1 parent f4aef75 commit e4a9c66
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/vite/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ export default function imagetools(userOptions: Partial<PluginOptions> = {}): Pl
}
}

return dataToEsm(outputFormat(outputMetadatas))
return dataToEsm(outputFormat(outputMetadatas), {
namedExports: viteConfig.json?.namedExports ?? true,
compact: !!viteConfig.build.minify ?? false,
preferConst: true
})
},

configureServer(server) {
Expand Down

0 comments on commit e4a9c66

Please sign in to comment.