I am trying to put by default and by export name in a single file. Example:
// file name : utils/fetch export default fetchUtil; module.exports = { fetch : fetchUtil, post, put, get, }; // import code import fetch from 'utils/fetch';
My code works fine with the web package, however errors appear in the browser:
fetchInit.js: 27 Uncaught TypeError: (0, _fetch2.default) is not a function
Am I missing something or is this not a way to do the default & named import in the same file?
source share