Closed marekdedic closed 10 months ago
This has nothing to do with this package specifically. This package has the correct ESM config.
https://gist.github.com/noraj/007a943dc781dc8dd3198a29205bae04
Great, that doc is exactly what I needed, thanks!
I suggest maybe adding a link to it to the v8 release? I think it applies here maybe more than the one linked currently...
Hi, I am trying to upgrade to v8, however, I am at a loss as to how to use this package... I have read the linked gist and I am on node 20, so I think I have all the prerequisites ready... However, given that this is a gulp plugin, I am a bit lost when it comes to the state of ESM in gulpfiles...
1) If I keep
const filter = require("gulp-filter");
, I getError [ERR_REQUIRE_ESM]: require() of ES Module...
2) If I switch it toconst filter = await import("gulp-filter");
, I getSyntaxError: await is only valid in async functions and the top level bodies of modules
3) If I switch toimport filter from "gulp-filter";
, I getSyntaxError: Cannot use import statement outside a module
. This happens even when I convert all import to this style...So it seems to me like gulpfiles cannot use ESM? If that's the case, does that mean v8 is unusable without a preprocessor like
ts-node
?