Skip to content

Instantly share code, notes, and snippets.

@neckerson
Last active June 10, 2019 03:47
Show Gist options
  • Save neckerson/fd24e76e5c3f38d5aef83baadd09d28b to your computer and use it in GitHub Desktop.
Save neckerson/fd24e76e5c3f38d5aef83baadd09d28b to your computer and use it in GitHub Desktop.
Expose jQuery $ in the window so it can be accessed by jQuery plugins
// In the root directory of the theme, install your plugin:
//
// > yarn add jquery-zoom
//
// Add the line below to the top of scripts/layout/theme.js
import $ from 'jquery';
// Below your imports, set up jQuery so that it can be accessed
// from the HTML
window.jQuery = $;
window.$ = $;
// Finally, require the plugin
require('jquery-zoom');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment