refactor: feature detection
This commit is contained in:
parent
5716cc12e3
commit
f8aeac6c8d
|
@ -12,7 +12,7 @@ module.exports = () => ({
|
||||||
path.node.specifiers = [
|
path.node.specifiers = [
|
||||||
types.importDefaultSpecifier(types.identifier(symbol)),
|
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 */
|
/* eslint-enable no-param-reassign */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user