I need to develop a npm package like wpcom-xhr-request, this package can be used in node and web, I cloned this package and give it a new name , create a personal git package. it can only work in web, when it is used in node, it give this error:
import requestHandler from 'acme-xhr-request';
^^^^^^
SyntaxError: Unexpected token import
at createScript (vm.js:80:10)
why does wpcom-xhr-request
can be used at both environment? how can do this without n8-make
? currently , makefile
make our work a litter complex , I don't like to introduce new complexity。