Skip to content

[Feature] Add ability to output explicit indexes #136

@jacobbogers

Description

@jacobbogers

Hello,

Example: this (transpiled) code loads the index.js file

import  {  some_function } from '../siblingdir';   // there is an index.js in the "siblingdir"

If i try to use this in an es6 fashion I will get ERR_UNSUPPORTED_DIR_IMPORT Because it is not possible in the esm standard to do directory imports, it has to be fully specified import { some_function } from '../siblingdir/index.js

I wonder if there is an options where it detects:

  • if it is a directory, add an /index.js suffix
  • if it is a normal file add the explicit extension '.js'

Cheers,

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions