Skip to content

Commit

Permalink
Enable JS minifier compatibility options
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Dec 23, 2022
1 parent 8d54c23 commit b60dac3
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tasks/compile-javascripts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ export async function compileJavaScript ([modulePath, { srcPath, destPath, minif
*/
export function minifyJavaScript (modulePath, result) {
const minified = minify({ [modulePath]: result.code }, {
ie8: true,
warnings: true,

// Include source maps
Expand All @@ -106,7 +105,17 @@ export function minifyJavaScript (modulePath, result) {
filename: result.map.file,
url: `${result.map.file}.map`,
includeSources: true
}
},

// Compatibility workarounds
module: false,
ie8: true,
webkit: true,
v8: true,

// Preserve names
// e.g. Accordion.prototype.isExpanded()
keep_fnames: true
})

if (minified.warnings) {
Expand Down

0 comments on commit b60dac3

Please sign in to comment.