loynoir

Results 97 comments of loynoir

I think `.mjs` is the only option to make dual module works. ```txt $ node --experimental-repl-await Welcome to Node.js v14.16.0. Type ".help" for more information. > require('.') 'cjs' > await...

### Work: `.mjs` ```txt "exports": { ".": { "require": "./x.js", "import": "./x.mjs", "default": "./x.js" } }, ``` ```txt > require('rjfxyrkr3z') 'cjs' > await import('rjfxyrkr3z') [Module: null prototype] { default: 'esm'...

As mention above, `.mjs` seems the only option for dual module. As it is dual module, and for backward compact, I wrote default condition as umd over esm. So, it...

@jogibear9988 To support `esprima.esm.js`, need declare "type=module" in package.json. ```txt // loading from `esprima.js` const { parse } = require('esprima') // Error [ERR_REQUIRE_ESM]: Must use import to load ES Module...

@jogibear9988 Tried to let tsc generate `.d.ts`, I have no idea what is going on, better using types from `@types/esprima` ```txt src/tokenizer.ts:122:5 - error TS4053: Return type of public method...

TS4053 fixed. Now there is `.d.ts`. 😏 Try it at, ```sh npm install loynoir/esprima ``` add `npm install ` support recently.

@lschirmbrand Yes. `jquery/esprima` git repo keep dist folder empty, and publish to npm with non-empty dist folder, so I somehow respect that way. But, I add `prepare` to npm scripts,...

@lschirmbrand Sorry. Haven't publish to npm. It is on github. If you are using 1. Bleeding edge new npm ```sh npm install loynoir/esprima // npm expand it to npm install...

@lschirmbrand Could you show some toolchain version? Maybe I could reproduce within a docker. ```sh node --version npm --version ```

@lschirmbrand `./dist` on `https://github.com/loynoir/esprima-es-dist` in case of you got stuck. But I might delete `https://github.com/loynoir/esprima-es-dist` in the future.