1- import { cpSync } from 'node:fs' ;
1+ import { cpSync , renameSync } from 'node:fs' ;
22import { resolve } from 'node:path' ;
33import { defineConfig , type Plugin } from 'vite' ;
44
55const outDir = 'src/wwwroot' ;
66const initializer = 'IgniteUI.Blazor.Lite.lib.module.js' ;
7+ const licenseManifest = 'THIRD-PARTY-LICENSES.md' ;
78/** Public modules keep fixed names so apps can import them and/or import maps can override them. */
89const fixedNames : Record < string , string > = { api : 'api.js' , 'lit-html' : 'lit-html.js' , legacyStub : 'app.bundle.js' } ;
910const entries = { app : 'src/src/index.ts' , api : 'src/src/api.ts' , legacyStub : 'src/src/app.bundle.ts' } ;
@@ -39,12 +40,14 @@ function emitInitializer(): Plugin {
3940 } ;
4041}
4142
42- /** Copy igniteui-webcomponents themes to wwwroot */
43+ /** Copy igniteui-webcomponents themes to wwwroot & move the license manifest */
4344function copyThemes ( ) : Plugin {
4445 return {
4546 name : 'ig-copy-themes' ,
4647 closeBundle ( ) {
4748 cpSync ( 'node_modules/igniteui-webcomponents/themes' , `${ outDir } /themes` , { recursive : true } ) ;
49+ // move out of wwwroot since it's not a web asset (rolldown only emits inside outDir)
50+ renameSync ( `${ outDir } /${ licenseManifest } ` , `src/${ licenseManifest } ` ) ;
4851 } ,
4952 } ;
5053}
@@ -61,7 +64,7 @@ export default defineConfig(({ mode }) => {
6164 outDir,
6265 emptyOutDir : true ,
6366 // One manifest of every bundled dependency's license; does not include inlined ones from rolldownOptions.output.comments.legal
64- license : { fileName : 'THIRD-PARTY-LICENSES.md' } ,
67+ license : { fileName : licenseManifest } ,
6568 sourcemap : isDev ,
6669 // Lib mode keeps the lazy imports free of vite's preload helper (import.meta.url-based — wrong under _content/).
6770 lib : { formats : [ 'es' ] } ,
0 commit comments