-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: add support for the .cjs
file extension
#59
Comments
.cjs
file extension.cjs
file extension
We can use a {
"flags": {
"gulpfile": "gulpfile.cjs"
}
} I close this ticket because this solution suits me. |
@cedx since node supports |
Probably: when I tried, it worked. At least, locally (see #60). |
It seems that this is only supposed to work when you are executing something with the I'm not sure why your solution is actually working 😬 |
It also seems like I don't think we can support |
Since Node.js 12.x (I don't know the exact version: maybe since 12.11.0), we can use the
.cjs
file extension to denote a JS file using the CommonJS module format.The issue: if we use
"type": "module"
inpackage.json
file, every file which extension ends with.js
is interpreted as an ES module. With this setting, Gulp fails when loading thegulpfile.js
file. The only way to force Node.js to interpret the Gulp file as a CommonJS module is to rename it asgulpfile.cjs
.If we do this, Gulp doesn't find anymore the
gulpfile.cjs
by itself. We need to use the--gulpfile
or-f
command file, which is cumbersome.The text was updated successfully, but these errors were encountered: