89
rated 0 times
[
91]
[
2]
/ answers: 1 / hits: 17251
/ 9 Years ago, mon, july 6, 2015, 12:00:00
I'm writing an isomorphic Key Value Store with webpack.
This is currently my approach to load the libraries, which obviously doesn't work, because webpack wants to resolve both require
.
Whats' the right approach?
var db = null;
if (typeof window === 'undefined') {
// node context
db = require('level');
} else {
// browser context
db = require('gazel');
}
I know, that you can provide a target to webpack.
But I have no idea how to use that.
Thanks!
More From » webpack