Skip to content

externalLiveBindings

  • Type: boolean
  • Optional

Whether to generate code to support live bindings for external imports.

With the default value of true, Rolldown will generate code to support live bindings for external imports.

When set to false, Rolldown will assume that exports from external modules do not change. This will allow Rolldown to generate smaller code. Note that this can cause issues when there are circular dependencies involving an external dependency.

Default

true

Example

js
// input
export { x } from 'external';
js
// CJS output with externalLiveBindings: true
var external = require('external');

Object.defineProperty(exports, 'x', {
  enumerable: true,
  get: function () {
    return external.x;
  },
});
js
// CJS output with externalLiveBindings: false
var external = require('external');

exports.x = external.x;

Released under the MIT License.