(cargoTomlPath: string, outputName: string)
| 139 | } |
| 140 | |
| 141 | export const createRustLicensePlugin = (cargoTomlPath: string, outputName: string) => { |
| 142 | const outputPath = join(process.cwd(), 'plugins', 'out', 'licenses', outputName) |
| 143 | |
| 144 | return { |
| 145 | name: 'vite-plugin-rust-license', |
| 146 | generateBundle() { |
| 147 | try { |
| 148 | console.log(`Generating Rust license info for ${cargoTomlPath}...`) |
| 149 | this.info(`Generating Rust license info for ${cargoTomlPath}...`) |
| 150 | generateCargoLicenseFile(cargoTomlPath, outputPath) |
| 151 | } catch (error) { |
| 152 | this.warn(`Failed to generate Rust license info: ${error}`) |
| 153 | console.error(error) |
| 154 | } |
| 155 | } |
| 156 | } as Plugin |
| 157 | } |
no outgoing calls
no test coverage detected