'use strict'; var pluginutils = require('@rollup/pluginutils'); var istanbul = require('istanbul-lib-instrument'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var istanbul__default = /*#__PURE__*/_interopDefaultLegacy(istanbul); function index (options = {}) { const filter = pluginutils.createFilter(options.include, options.exclude); return { name: 'istanbul', transform (code, id) { if (!filter(id)) return; let instrumenter; const instrumenterConfig = Object.assign({ esModules: true, compact: true, produceSourceMap: true, autoWrap: true, preserveComments: true }, options.instrumenterConfig); instrumenter = new (options.instrumenter || istanbul__default['default']).createInstrumenter(instrumenterConfig); code = instrumenter.instrumentSync(code, id); const map = instrumenter.lastSourceMap(); return { code, map }; } }; } module.exports = index;