Skip to content

Instantly share code, notes, and snippets.

@aduth

aduth/prep.php Secret

Created February 5, 2019 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aduth/e5cb3cbe8124ed948c7e06c9ba3bd79c to your computer and use it in GitHub Desktop.
Save aduth/e5cb3cbe8124ed948c7e06c9ba3bd79c to your computer and use it in GitHub Desktop.
<?php
$script = file_get_contents( 'script.js' );
$script = str_replace( 'export default', 'exports =' );
$script = 'return ( function() { var exports;' . $script . ' } )();';
export default {
icon: 'whatever',
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment