gulpjs / interpret

A dictionary of file extensions and associated module loaders.
MIT License
259 stars 47 forks source link

Add .cts file extension #89

Closed cspotcode closed 2 years ago

cspotcode commented 2 years ago

Before you open this issue, please complete the following tasks:

Our thoughts on feature requests

Lots of developers rely on gulp, so we don't make big changes very often. Not every feature request will be added to gulp, but hearing about what you want is important. Don't be afraid to submit a feature request!

Describe your idea for a new feature

Add .cts file extension, with the same treatment as .ts.

Explain the problem your idea is trying to solve

In projects with package.json "type": "module", .ts files are treated as native ESM, so people may choose to write their config files with a .cts file extension instead. This file extension is supported by TypeScript and ts-node.

How will it benefit gulp and its users?

Users can write config files with the .cts file extension, and interpret will be able to execute them.

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?

cspotcode commented 2 years ago

Note that there is also the .mts file extension, but that executes as ESM, so would typically require using node --loader ts-node/esm