logan
12/14/2017, 1:40 PMnode_modules
in a Hook function – the function runs and works locally. Any specific way to bundle node_modules into a function?
(relevant forum post: https://www.graph.cool/forum/t/how-to-import-node-modules-into-hook-function/1684/2)max
12/14/2017, 1:48 PMlogan
12/14/2017, 1:50 PMnode-fetch
works for me, it turns out. node’s request
module wasn’t available… for another module I had to require
instead of import
. I’m not sure why exactly 😅max
12/14/2017, 1:53 PMimport * as moment from 'moment'
instead of import moment from 'moment'
. The second import works in JS ES6 but not in TypeScript. I think it's due to some kind of transpiling on the backend to TypeScript.max
12/14/2017, 1:53 PMimport * as moment from 'moment'
on node modules without a default export.max
12/14/2017, 1:54 PMrequire
logan
12/14/2017, 2:02 PM