Skip to content

Add support for gulpfile.cjs #2653

Closed

Description

@david-bojnansky

Describe your idea for a new feature

Add support for gulpfile.cjs

Explain the problem your idea is trying to solve

In package.json I have type set to module but I would like to have gulpfile in CommonJS format (.cjs) with require()s. Seems like not possible now.

How will it benefit gulp and its users?

They could code Gulp tasks in CommonJS format without to worry about module type.

If this feature could exist outside of gulp (like as a plugin or a module), would you be interested in helping to create and maintain it?

Activity

  1. phated commented on Nov 28, 2021

    @phated
    Member

    Can you provide a reproduction that doesn't work?

  2. david-bojnansky commented on Nov 29, 2021

    @david-bojnansky
    Author

    @phated Sorry, I just didn'ť mentioned that it is about filename. If I create gulpfile.cjs it isn't taken into account as gulpfile.js is. Of course, if I specify it explicitly like npx gulp -f gulpfile.cjs sample it works.

    Yeah, if I look what I typed it seems like it does not work in CJS format at all what is not true. This issue had to be about supporting gulpfile.cjs same as gulpfile.js which excludes for example specifying file with -f option.

  3. WalterWoshid commented on Dec 7, 2023

    @WalterWoshid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions