Skip to content

Change bin/jsx default file extension to .jsx #832

@andrewdavey

Description

@andrewdavey

Currently, bin/jsx defaults to looking for .js files to which contain jsx content to compile. Whilst it's possible to override this using jsx -x jsx ..., I think that since jsx content is not valid JavaScript, using the .js extension by default isn't ideal.

Could we change bin/jsx to look for .jsx files instead?

Another advantage to this is that the generated .js files can live the same directory as the source .jsx. This simplifies the generation of source maps files as well, because the path to the .jsx is trivially relative to the generated .js

For example, given foo.jsx, running jsx . . would result in:

$ ls
foo.jsx
foo.js
foo.js.map

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions