huozhi / bunchee

Zero config bundler for ECMAScript and TypeScript packages
https://npmjs.com/bunchee
926 stars 29 forks source link

unexpected add node polyfill #564

Closed himself65 closed 2 months ago

himself65 commented 2 months ago
const __getOwnPropNames = Object.getOwnPropertyNames
var __commonJS = (cb, mod) =>
  function __require () {
    return (
      mod ||
      (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod),
        mod.exports
    )
  }

export const a = 1

turn into

import __node_cjsModule from 'node:module';

__node_cjsModule.createRequire(import.meta.url);
const a = 1;

export { a };
himself65 commented 2 months ago

context: I don't want any environment polyfill since I'm releasing the code to both deno, bun and nodejs