snowpack
Version:
The ESM-powered frontend build tool. Fast, lightweight, unbundled.
16 lines (15 loc) • 972 B
TypeScript
import { Plugin } from 'rollup';
import { AbstractLogger, InstallTarget } from '../types';
/**
* rollup-plugin-wrap-install-targets
*
* How it works:
* 1. An array of "install targets" are passed in, describing all known imports + metadata.
* 2. If isTreeshake: Known imports are marked for tree-shaking by appending 'snowpack-wrap:' to the input value.
* 3. If autoDetectPackageExports match: Also mark for wrapping, and use automatic export detection.
* 4. On load, we return a false virtual file for all "snowpack-wrap:" inputs.
* a. That virtual file contains only `export ... from 'ACTUAL_FILE_PATH';` exports
* b. Rollup uses those exports to drive its tree-shaking algorithm.
* c. Rollup uses those exports to inform its "namedExports" for Common.js entrypoints.
*/
export declare function rollupPluginWrapInstallTargets(isTreeshake: boolean, autoDetectPackageExports: string[], installTargets: InstallTarget[], logger: AbstractLogger): Plugin;