rockerest’s avatarrockerest’s Twitter Archive—№ 20,392

  1. …in reply to @ryanmr
    ryanmr > are you using TS? Never. > are you using the file extensions in paths Always, strictly, per the standard. For loading non-ESM files, I use a small script (very small) based on esbuild: esbuild.github.io/
    OpenGraph image for esbuild.github.io/
    1. …in reply to @rockerest
      ryanmr I haven't personally dealt with extensionless imports (as that's purely a Node colloquialism, and doesn't function on the web), BUT there has been some advancement for tooling in that regard because bare module specifiers can be beneficial for library authors in some cases.
      1. …in reply to @rockerest
        ryanmr For example, esbuild implicitly understands the node file resolution algorithm, so I believe (no promises) that extensionless imports are resolved as you would expect. Can promise that bare module specifiers (e.g. import { html } from "lit") does work, but that...
        1. …in reply to @rockerest
          ryanmr ... has slightly different semantics than import { html } from "../something/here"; I would _hope_ they're resolved in roughly the same way by a Node resolution algorithm, but I'm not sure.