Q:

Is module export create a new instance each time when import

// src/utils/http.js
import axios from 'axios';

const axiosInstance = axios.create({
  baseURL: process.env.VUE_APP_API_BASE_URL,
});

export default axiosInstance;''

when import the above module import http from './http' does it create a new axios instance each time? or it is singleton?

A:

"ES6 Modules are singletons - the instance is created when module is loaded."

