Closed diegone closed 2 years ago
Can you explain more about the error you get and how you are using it?
I just tested the last version with a simple HTML code and <script type="module">
and it work without any trouble with the ESM file.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<script type="module">
import { detect } from './dist/tinyld.esm.js'
console.log(detect('test my text'))
</script>
</body>
</html>
Sorry, I should have been more specific. This happened to me using Node.js 16.13.1. If I do import('tinyld')
from the REPL or import tinild from 'tinild'
from my module, I get a dump of the source and a SyntaxError: Unexpected token 'export'
exception. The same works fine with 1.2.0.
This should be solved in last version 👍
CJS require works but ESM import throws an exception from version 1.2.1 to 1.2.3. Version 1.2.0 works fine.