Anyone knows how I can import each of below function in Vue and React without an error? Right now I am getting an error if I am importing vueFetch and reactFetch.
So if am importing vueFetch into a Vue project, I am getting an error for React that React is not defined and the same applies if I import reactFetch (Vue ref not defined).
import { vueFetch } from './composables/vue/vue-fetch';
import { reactFetch } from './composables/react/react-fetch';
export { vueFetch, reactFetch };
I am trying to make a Vue and React NPM package, but I only have one index file, and I need to import both Hook into the single index file. So I do not need to create 2 packages.
here is the link to the package: https://www.npmjs.com/package/use-lightweight-fetch
index.js(well, no, you can technically have two, one for ESM and one for CJS, but that's not relevant here) but thatindex.jscan export two different imports from two different files, so that someone can sayimport { VueThing } from "libraryname";and then have treeshaking during bundling remove all the code for "the framework I'm not using".