vercel / vercel/ncc

Better esm support

Open
#488 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
9.8k
Forks
326
PR merge metrics
No merged PRs in 30d

Description

I noticed in https://github.com/zeit/webpack-asset-relocator-loader/pull/27 and https://github.com/zeit/ncc/pull/365 that esm support was added but only in the cases of require = require('esm')(module);.

What doesn't seem to be supported is this.

const _require = require('esm')(module);
const myModule = _require('my-module');

More info at https://github.com/zeit/webpack-asset-relocator-loader/issues/74.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the supported require = require('esm')(module) case with the _require alias example in this issue. Read the referenced webpack-asset-relocator-loader pull request and issue, then trace the corresponding ncc handling. Done means the aliased require form is bundled correctly without regressing the existing ESM case.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.