Last active
June 10, 2019 03:47
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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