rolldown 0.1.0

Fast JavaScript bundler in Rust, designed for the future of Vite
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// This fallback "require" function exists so that "typeof require" can
// naturally be "function" even in non-CommonJS environments since esbuild
// emulates a CommonJS environment (issue #1202). However, people want this
// shim to fall back to "globalThis.require" even if it's defined later
// (including property accesses such as "require.resolve") so we need to
// use a proxy (issue #1614).
export var __require = /* @__PURE__ */ (x =>
  typeof require !== 'undefined' ? require :
    typeof Proxy !== 'undefined' ? new Proxy(x, {
      get: (a, b) => (typeof require !== 'undefined' ? require : a)[b]
    }) : x
)(function (x) {
  if (typeof require !== 'undefined') return require.apply(this, arguments)
  throw Error('Calling `require` for "' + x + '" in an environment that doesn\'t expose the `require` function.')
});