Skip to content

Commit

Permalink
Rename .mjs to .js since servers may not be configured for file type
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Aug 23, 2021
1 parent 3b044de commit 46aa70a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,15 @@ module.exports = function (grunt) {
},
install_workbox: {
command:
'if [ -e wp-includes/js/workbox* ]; then rm -r wp-includes/js/workbox*; fi; npx workbox copyLibraries wp-includes/js/',
'if [ -e wp-includes/js/workbox* ]; then ' +
'rm -r wp-includes/js/workbox*; ' +
'fi; ' +
'npx workbox copyLibraries wp-includes/js/;' +
// Rename .mjs with .js since servers may not be configured to serve the former as text/javascript.
'for mjs in wp-includes/js/workbox*/*.mjs; do ' +
'sed "s/\\.mjs/.js/g" "$mjs" > "${mjs%mjs}js";' +
'rm $mjs;' +
'done;',
},
create_build_zip: {
command:
Expand Down

0 comments on commit 46aa70a

Please sign in to comment.