Closed jeeger closed 1 year ago
I really have no idea—as far as I'm aware lezer-generator
is a valid npm package. I don't know why yarn 2 would have trouble loading it.
I think the problem is that lezer-generator does not reference src/rollup-plugin-lezer.ts
in src/index.ts
, and thus it's not included in the file generated by rollup when the package is built.
I've managed to work around it by using import {lezer} from "lezer-generator/dist/rollup-plugin-lezer.cjs"
, but that took some working around.
I think the problem is that lezer-generator does not reference src/rollup-plugin-lezer.ts in src/index.ts, and thus it's not included in the file generated by rollup when the package is built.
No, that's intentional. It's distributed in dist/rollup-plugin-lezer.{cjs,es.js}, and should be included as "lezer-generator/rollup"
. Is it possible that some tool you're using just doesn't handle the exports
field in package.json yet?
From my reading of the yarn 1 and 2 documentation, neither of them knows about a "exports" field in package.json, so I think I'm misunderstanding here.
Since I was able to produce the bug with a official project, I think there's a misconfiguration/compatibility issue somewhere in the build system. If you think incompatibility with yarn 2 is a bug, feel free to close this!
Yarn 2's PnP got exports
support in https://github.com/yarnpkg/berry/pull/2431 but it hasn't been released yet, you can update to the source version and see if that fixes it.
yarn set version from sources
I'm trying to create a new codemirror language, and I'm using yarn 2 and rollup. I've successfully built
lang-sql
with yarn 1, but changing configuration to yarn 2 leads to an error.The problem seems to be the extra
dist
directory in thelezer-generator-npm
package. Is there a way to work around this error?