packages/dce/src/used-exports.js
function onLocalModuleBinding(ident, ast, acc) {
  traverse(ast, {
    CallExpression({ node: callExpression }) {
      // left must be a member expression
      if (t.isMemberExpression(callExpression.callee) === false) {
        return;
      }

      const memberExpression = callExpression.callee;

      /**
       * Search for `makeX().then(...)`
       */
      if (
        t.isCallExpression(memberExpression.object) &&
        memberExpression.object.callee.name === ident.name &&
        memberExpression.property.name === "then"
      ) {
        const [thenFnBody] = callExpression.arguments;

        if (typeof thenFnBody === "undefined") {
          return;
        }

        onInstanceThenFn(thenFnBody, acc);
      }
    }
  });
}
function onLocalModuleBinding(ident, ast, acc) {
  traverse(ast, {
    CallExpression({ node: callExpression }) {
      // left must be a member expression
      if (t.isMemberExpression(callExpression.callee) === false) {
        return;
      }

      const memberExpression = callExpression.callee;

      /**
       * Search for `makeX().then(...)`
       */
      if (
        t.isCallExpression(memberExpression.object) &&
        memberExpression.object.callee.name === ident.name &&
        memberExpression.property.name === "then"
      ) {
        const [thenFnBody] = callExpression.arguments;

        if (typeof thenFnBody === "undefined") {
          return;
        }

        onInstanceThenFn(thenFnBody, acc);
      }
    }
  });
}
function onLocalModuleBinding ( ident , ast , acc ) { traverse ( ast , { CallExpression ( { node : callExpression } ) { // left must be a member expression if ( t . isMemberExpression ( callExpression . callee ) === false ) { return ; } const memberExpression = callExpression . callee ; /**
       * Search for `makeX().then(...)`
       */ if ( t . isCallExpression ( memberExpression . object ) && memberExpression . object . callee . name === ident . name && memberExpression . property . name === "then" ) { const [ thenFnBody ] = callExpression . arguments ; if ( typeof thenFnBody === "undefined" ) { return ; } onInstanceThenFn ( thenFnBody , acc ) ; } } } ) ; }
We found a local binding from the wasm binary.

`import x from 'module.wasm'`
^
We found a local binding from the wasm binary .