I am working on a html project. I have 2 js file like main.js
and config.js
. I have some default export in config.js
. So I was using import statement in main.js
while it is giving me error Cannot use import outside of a module. Is there anyway to import config.js
inside main.js
?
config.js file
export const config = {
identityBaseURL : 'https://url1.azurewebsites.net/',
tenantId : '1234',
}
the above code is my config that I exported from config.js
and wanted to import in main.js
import config from './config.js';
The above line I am using to import my config file into main.js
file but I am getting the error which is Cannot use import outside of a module.