rollupLicensePlugin.ts — vite Source File
Architecture documentation for rollupLicensePlugin.ts, a typescript file in the vite codebase. 4 imports, 2 dependents.
Entity Profile
Dependency Diagram
graph LR 8c8944ff_c444_0ebb_8419_eb691db97f08["rollupLicensePlugin.ts"] e6032fbc_44cf_58d6_868d_dd15106c18c5["node:fs"] 8c8944ff_c444_0ebb_8419_eb691db97f08 --> e6032fbc_44cf_58d6_868d_dd15106c18c5 478b255e_884d_9569_4654_2dbd11003ea8["rollup-plugin-license"] 8c8944ff_c444_0ebb_8419_eb691db97f08 --> 478b255e_884d_9569_4654_2dbd11003ea8 bff4f846_ab01_b5ba_74d4_c1608e434d2c["picocolors"] 8c8944ff_c444_0ebb_8419_eb691db97f08 --> bff4f846_ab01_b5ba_74d4_c1608e434d2c 6701bba9_3d8f_f5b8_c0a6_edc7752de5de["rollup"] 8c8944ff_c444_0ebb_8419_eb691db97f08 --> 6701bba9_3d8f_f5b8_c0a6_edc7752de5de 5124f25d_d687_b4fb_be4e_70d55732b289["tsdown.config.ts"] 5124f25d_d687_b4fb_be4e_70d55732b289 --> 8c8944ff_c444_0ebb_8419_eb691db97f08 095867e3_0044_bba5_61f7_c60c3c9e56ce["rolldown.config.ts"] 095867e3_0044_bba5_61f7_c60c3c9e56ce --> 8c8944ff_c444_0ebb_8419_eb691db97f08 style 8c8944ff_c444_0ebb_8419_eb691db97f08 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import fs from 'node:fs'
import license from 'rollup-plugin-license'
import type { Dependency } from 'rollup-plugin-license'
import colors from 'picocolors'
import type { Plugin, PluginContext } from 'rollup'
export default function licensePlugin(
licenseFilePath: string,
licenseTitle: string,
packageName: string,
additionalSection?: string,
): Plugin {
const originalPlugin = license({
thirdParty(dependencies) {
// https://github.com/rollup/rollup/blob/master/build-plugins/generate-license-file.js
// MIT Licensed https://github.com/rollup/rollup/blob/master/LICENSE-CORE.md
const coreLicense = fs.readFileSync(
new URL('../../LICENSE', import.meta.url),
)
const deps = sortDependencies(dependencies)
const licenses = sortLicenses(
new Set(
dependencies.map((dep) => dep.license).filter(Boolean) as string[],
),
)
let dependencyLicenseTexts = ''
for (let i = 0; i < deps.length; i++) {
// Find dependencies with the same license text so it can be shared
const licenseText = deps[i].licenseText
const sameDeps = [deps[i]]
if (licenseText) {
for (let j = i + 1; j < deps.length; j++) {
if (licenseText === deps[j].licenseText) {
sameDeps.push(...deps.splice(j, 1))
j--
}
}
}
let text = `## ${sameDeps.map((d) => d.name).join(', ')}\n`
const depInfos = sameDeps.map((d) => getDependencyInformation(d))
// If all same dependencies have the same license and contributor names, show them only once
if (
depInfos.length > 1 &&
depInfos.every(
(info) =>
info.license === depInfos[0].license &&
info.names === depInfos[0].names,
)
) {
const { license, names } = depInfos[0]
const repositoryText = depInfos
.map((info) => info.repository)
.filter(Boolean)
.join(', ')
if (license) text += `License: ${license}\n`
// ... (144 more lines)
Domain
Subdomains
Functions
Types
Dependencies
- node:fs
- picocolors
- rollup
- rollup-plugin-license
Source
Frequently Asked Questions
What does rollupLicensePlugin.ts do?
rollupLicensePlugin.ts is a source file in the vite codebase, written in typescript. It belongs to the HMRClient domain, HotRuntime subdomain.
What functions are defined in rollupLicensePlugin.ts?
rollupLicensePlugin.ts defines 5 function(s): getDependencyInformation, licensePlugin, normalizeGitUrl, sortDependencies, sortLicenses.
What does rollupLicensePlugin.ts depend on?
rollupLicensePlugin.ts imports 4 module(s): node:fs, picocolors, rollup, rollup-plugin-license.
What files import rollupLicensePlugin.ts?
rollupLicensePlugin.ts is imported by 2 file(s): rolldown.config.ts, tsdown.config.ts.
Where is rollupLicensePlugin.ts in the architecture?
rollupLicensePlugin.ts is located at packages/vite/rollupLicensePlugin.ts (domain: HMRClient, subdomain: HotRuntime, directory: packages/vite).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free