Created
February 2, 2018 19:49
-
-
Save JustinBeckwith/c48bc7aeb4c0d751688470555d6f6ce3 to your computer and use it in GitHub Desktop.
Webpack bug
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
<html> | |
<head> | |
<title>Getting Started</title> | |
</head> | |
<body> | |
<script src="bundle.js"></script> | |
</body> | |
</html> |
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
{ | |
"name": "gal-web", | |
"version": "1.0.0", | |
"scripts": { | |
"webpack": "webpack" | |
}, | |
"license": "ISC", | |
"devDependencies": { | |
"webpack": "^3.10.0" | |
}, | |
"dependencies": { | |
"google-auth-library": "^1.2.1" | |
} | |
} |
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
import {OAuth2Client} from 'google-auth-library'; | |
function doAuth() { | |
const client_id = "some-key"; | |
const url = 'https://www.googleapis.com/plus/v1/people?query=pizza'; | |
return oAuth2Client.request({ url }).then(res => { | |
console.log(res.data); | |
const client = new OAuth2Client({client_id}); | |
const authorizeUrl = oAuth2Client.generateAuthUrl({ | |
access_type: 'offline', | |
scope: 'https://www.googleapis.com/auth/plus.me' | |
}); | |
window.open(authorizeUrl); | |
}).catch(e => { | |
console.error(':('); | |
console.error(e); | |
}); | |
} | |
doAuth(); |
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 path = require('path'); | |
module.exports = { | |
entry: './src/index.js', | |
output: { | |
path: path.resolve(__dirname, 'dist'), | |
filename: 'bundle.js' | |
}, | |
node: { | |
fs: 'empty', | |
child_process: 'empty' | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment