I've been trying to use ES6 codes to split up my codes so I won't have everything all on my main.js
I've tried to use import/export such as:
//example1.js
export var str = 'hello world';
//main.js
import exampleStr from './example1';
However, I will get the following error:
Uncaught SyntaxError: Unexpected identifier
From what I had google'd, current web browsers do not support modules and I am using Google Chrome.
I tried to use Babel and Webpack but both of these seem to require everything to be bundled together. Even then, everything was even more confusing.
How would people split up their codes using import/export or do people simply use script tags to import their js files?
I am currently using Atom as well to program javascript/html.