hyrious
hyrious
This is needed to compute the output files names. Unless you've noticed, if you have one input then the output file would be called ``.
Does this work for you? [playground link](https://esbuild.github.io/try/#YgAwLjE4LjExAC0tZm9ybWF0PWVzbSAtLWJ1bmRsZSAtLWV4dGVybmFsOi4vYi5qcyAtLWV4dGVybmFsOi4vYS5qcwBlAGVudHJ5LmpzAGV4cG9ydCAqIGZyb20gJy4vYScKZXhwb3J0ICogZnJvbSAnLi9iJwpleHBvcnQgKiBmcm9tICcuL2V4dGVybmFsJwAAYS5qcwBleHBvcnQgY29uc3QgYSA9ICdhJwAAYi5qcwBleHBvcnQgY29uc3QgYiA9ICdiJwAAZXh0ZXJuYWwuanMAZXhwb3J0IGNvbnN0IGV4dGVybmFsID0gJ2V4dGVybmFsJw) ```bash esbuild entry.js --format=esm --bundle --external:./b.js --external:./a.js ``` > ❌ Paths would accidentally specify internal paths to non-bundled external packages No, the `--external:./a.js`...
[`yarn node`](https://yarnpkg.com/cli/node) currently does [not](https://yarnpkg.com/getting-started/qa#does-yarn-support-esm) work on es modules (.mjs). You have to write CJS to let yarn hack into the script.
Interestingly, rollup does not support pure annotation before tagged template literals too, related issue here: https://github.com/rollup/rollup/issues/4035 On the other hand, rollup does support `/* @__NO_SIDE_EFFECTS__ */` to mark the function...
The `define` option can only replace JSON literals and a few `a.b` like variables. However, you can use the [inject](https://esbuild.github.io/api/#inject) option to provide variables in a more expressive way. For...
`tsup` uses `bundle-require` to load its options, which runs esbuild with a custom resolver plugin that intentionally marks all paths with `node_modules` as external: https://github.com/egoist/bundle-require/commit/61f98ee In fact, there's a similar...
To achieve something similar to what you're asking for, I'm using esbuild to generate the ESM bundle, then feeding it to rollup to produce other formats like CJS and IIFE...
Node.js has a `--watch` option. You can do something like this: ```bash # concurrently esbuild --watch main.ts --bundle --platform=node --outdir=. node --watch main.js ```
I didn't run benchmarks. However you may find some clue in their technical details: - `tsx` and `ts-node` are using esm loaders and `require.extensions` to hack into Node.js execution and...
The shell operator `a && b` means only when the former command **exits** successfully then the latter command will run. Obviously neither esbuild or node would exit in watch mode....