I have been trying to convert an HTML template (includes JS and CSS) to VueJS app. The template is structured and modularised in such a way that JavaScript functions from other local JavaScript files are used repeatedly within other local files.
The problem now is that I am getting undefined variable errors in my JavaScript files when imported within a Vue single-page app.
For example:
file validate.js has validate_username() and validate_email()
file login.js has login()
file register.js has register() but uses validate_username() and login() from other files.
How I tried to import the files in Vue:
import './assets/validate.js';
import './assets/login.js';
import './assets/register.js';
I am getting validate_username() not defined in register.js