I am testing the use of the ECMA2015 modules and something will be wrong because I can not use it. My code is as follows:
//Archivo libreria.js
export {unaFuncion, otraFuncion};
function unaFuncion() {
console.log('Escrito desde unaFuncion');
}
function otraFuncion() {
console.log('Escrito desde otraFuncion');
}
//Archivo main.js
import {unaFuncion, otraFuncion} from 'libreria';
unaFuncion();
otraFuncion();
<!DOCTYPE html>
<html>
<head>
<title>Probando modulos</title>
<script src="main.js"></script>
</head>
<body>
</body>
</html>
Testing in Chrome version 64.