Skip to content

Feature request: Add support for esm. #52

@coreyfarrell

Description

@coreyfarrell

I'd like to request that esm be added if possible. Bad news I just tried adding it and couldn't get it to work. I added '.esm.mjs': 'esm', to extensions and '.esm.mjs' to jsVariantExtensions. This caused the following from gulp:

$ gulp
[21:05:15] Requiring external module esm
/home/coreyfarrell/test/gulpfile.esm.mjs:1
(function (exports, require, module, __filename, __dirname) { import log from 'gulplog';
                                                                     ^^^

SyntaxError: Unexpected identifier
    at new Script (vm.js:74:7)
    at createScript (vm.js:246:10)
    at Object.runInThisContext (vm.js:298:10)
    at Module._compile (internal/modules/cjs/loader.js:670:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
    at Module.load (internal/modules/cjs/loader.js:612:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
    at Function.Module._load (internal/modules/cjs/loader.js:543:3)
    at Module.require (internal/modules/cjs/loader.js:650:17)
    at require (internal/modules/cjs/helpers.js:20:18)

The result was the same for gulp and npx gulp (global gulp-cli vs local gulp-cli).

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