Last active
March 29, 2017 14:58
-
-
Save vamsiampolu/48d1baee159bb9b8ff46cdf03d5f8635 to your computer and use it in GitHub Desktop.
Webpack Google APIs with scriptjs
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
require('expose?gapiCallback!./google-client-code'); | |
require('expose?gmapsCallback!./google-maps-code'); | |
$script('https://maps.googleapis.com/maps/api/js?onload=window.gapiCallback','google-maps'); | |
$script('https://apis.google.com/js/client.js?callback=window.gmapsCallback','google-api'); |
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
const googleClient = () => { | |
console.log(gapi); | |
}; | |
export default googleClient; |
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
const mapsCallback = () => { | |
console.log(google); | |
}; | |
export default mapsCallback; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I posted a comment on your medium article. What I see is that the webpack loader is not needed.
Here's the link