Skip to content

Commit

Permalink
feat: default builds to ES2015 for compatibility
Browse files Browse the repository at this point in the history
Vite 3 switched to 'modules' by default. This ensures maximum browser compatibility.
  • Loading branch information
cshawaus committed Jul 29, 2022
1 parent c5852c2 commit 996f11b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ export function viteForAem(options: PluginOptions): PluginOption[] {
},
}

config.build = {
...(config.build || {}),

// Always prefer maximum browser compatibility
target: 'es2015',
}

config.server = {
...(config.server || {}),

Expand Down

0 comments on commit 996f11b

Please sign in to comment.