refactor: feature detection

This commit is contained in:
cha0s 2021-04-01 14:43:02 -05:00
parent 5716cc12e3
commit f8aeac6c8d

View File

@ -12,7 +12,7 @@ module.exports = () => ({
path.node.specifiers = [
types.importDefaultSpecifier(types.identifier(symbol)),
];
path.insertAfter(parser.parse(`if ('client' === process.env.SIDE) ${symbol}.use();`));
path.insertAfter(parser.parse(`if ('undefined' !== typeof document) ${symbol}.use();`));
}
},
/* eslint-enable no-param-reassign */