In this scenario, I have a collection of libraries that I've defined.
One such library is lib1.js:
export default {
Func1() {
return ...
}
}
(and similarly for my other libraries in the same folder)
Now, I am importing these libraries into a main file called api.js, along with lib2 and lib3:
import './lib1';
import './lib2';
import './lib3';
Within my Vue component:
<script>
import * as Api from '@/api/api';
mounted() {
Api.func1();
}
</script>
A certain Mix error occurs indicating that the functions cannot be found:
"export 'Func1' (imported as 'Api') was not found in '@/api/api' ....
I have confirmed that the pathing is correct because directly importing the libraries into the view works fine:
For example in Vue:
<script>
import Lib1 from '@/api/lib1'
import Lib2 from '@/api/lib2'
import Lib3 from '@/api/lib3'
mounted() {
Lib1.func1();
...
}
</script>
I'm puzzled by this situation. I simply want one "master" file to handle the importation of all my API functions instead of having to import each one individually.
Additional context: I am using Laraval 6 alongside Vue.