Has anyone figured out a way to import lodash/fp
(the functional variant of lodash)?
Both of these ways don’t seem to work.
_ = require('lodash/fp')
_ = require('https://cdn.jsdelivr.net/g/lodash@4(lodash.min.js+lodash.fp.min.js)')
Has anyone figured out a way to import lodash/fp
(the functional variant of lodash)?
Both of these ways don’t seem to work.
_ = require('lodash/fp')
_ = require('https://cdn.jsdelivr.net/g/lodash@4(lodash.min.js+lodash.fp.min.js)')
That took some sleuthing due to idiosyncrasies in how lodash publishes, but here you go:
Thanks Mike! You are the best!
Should I use this approach to require individual functions? This doesn’t seem to work:
I also tried require('lodash/uniq')
.
you could do this
uniq = require('lodash.uniq').catch(() => window.uniq)
or use skypack to load it
uniq = (await import("https://cdn.skypack.dev/lodash.uniq")).default