Skip to content

Named exports for non-ES6 #334

@guybedford

Description

@guybedford

We can enable importing named exports for non-ES6 modules like:

import { readFile } from 'fs';

To do this means making the module object look like:

var mObj = { default: require('fs') };
// extend with named properties before defining the module
extend(mObj, mObj.default);
return System.newModule(mObj);

This is effectively what 6to5 does. It's just a one way road we should go down carefully...

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