import type { PackageSettings } from './PackageSettings.js'; import type { TargetEnvironment } from './TargetEnvironment.js'; /** * Options for creating bundles with a bundler plugin. */ export interface BundleOptions extends Pick { /** * Original (not transformed) name of the package being bundled. */ packageName: string; /** * The absolute input path for the entry points. */ inputPath: string; /** * Mapping from output file to source file paths. * - Key is the output file path, relative to `outputPath` (with forward slashes and leading `./`) * and *without* the extension (unless it's non-JS). * - Value is the input file path, relative to `inputPath` (with forward slashes and leading `./`) * including the extension. * * For example: * `{ './lib/index': './src/index.js' }` * * Note: Non-javascript extensions, such as `.css` or `.scss`, will not be stripped from the key. * This is to ensure the bundler keeps the original extension intact and adds `.js` after it. */ entries: Record; /** * Target environment for the bundle. * * WARNING: `'node'` environment is a work in progress and may not be fully supported. * Also, currently it causes package to be bundled in **production mode** since import maps * aren't supported in Node yet. */ targetEnvironment: TargetEnvironment; /** * The output path for bundled files. This can be either relative to `inputPath`, or absolute. * Defaults to `inputPath`. */ outputPath?: string; /** * List of dependencies which should be externalized. */ external?: string[]; /** * List of dependencies which should be inlined. */ inlined?: string[]; /** * If true, minify the output. */ minify?: boolean; /** * If true, will generate sourcemap files for the output. This has a tax on performance. * Defaults to true unless the `disableSourceMaps` feature is enabled. * (To set a bundler-specific sourcemap option, use `bundlerOptions`.) */ sourcemap?: boolean; /** * If true, the bundler is expected to stay alive and take requests to rebuild on demand. File watching is * managed at a higher layer. When we no longer care about incremental bundling, the bundler will receive a call * to `dispose` if returned. */ incremental?: boolean; /** * Bundler aliases for deduped packages. Maps package names to their resolved paths * to ensure all imports use the same version when bundling inlined dependencies. */ dedupeAliases?: Record; /** If true, enables Hot Module Replacement (HMR) for the bundle. */ hmr?: boolean; } //# sourceMappingURL=BundleOptions.d.ts.map