@@ -38,20 +38,20 @@ export async function rollupBuild(ctx: BuildContext) {
3838 const jitiPath = await resolvePath ( "jiti" , { url : import . meta. url } ) ;
3939
4040 for ( const entry of ctx . options . entries . filter (
41- ( entry ) => entry . builder === "rollup"
41+ ( entry ) => entry . builder === "rollup" ,
4242 ) ) {
4343 const output = resolve (
4444 ctx . options . rootDir ,
4545 ctx . options . outDir ,
46- entry . name !
46+ entry . name ! ,
4747 ) ;
4848
4949 const resolvedEntry = normalize (
50- tryResolve ( entry . input , ctx . options . rootDir ) || entry . input
50+ tryResolve ( entry . input , ctx . options . rootDir ) || entry . input ,
5151 ) ;
5252 const resolvedEntryWithoutExt = resolvedEntry . slice (
5353 0 ,
54- Math . max ( 0 , resolvedEntry . length - extname ( resolvedEntry ) . length )
54+ Math . max ( 0 , resolvedEntry . length - extname ( resolvedEntry ) . length ) ,
5555 ) ;
5656 const code = await fsp . readFile ( resolvedEntry , "utf8" ) ;
5757 const shebang = getShebang ( code ) ;
@@ -63,10 +63,10 @@ export async function rollupBuild(ctx: BuildContext) {
6363 await writeFile (
6464 output + ".cjs" ,
6565 `${ shebang } module.exports = require(${ JSON . stringify (
66- jitiPath
66+ jitiPath ,
6767 ) } )(null, { interopDefault: true, esmResolve: true })(${ JSON . stringify (
68- resolvedEntry
69- ) } )`
68+ resolvedEntry ,
69+ ) } )`,
7070 ) ;
7171 }
7272
@@ -76,7 +76,7 @@ export async function rollupBuild(ctx: BuildContext) {
7676 resolvedEntry ,
7777 {
7878 extensions : DEFAULT_EXTENSIONS ,
79- }
79+ } ,
8080 ) . catch ( ( error ) => {
8181 warn ( ctx , `Cannot analyze ${ resolvedEntry } for exports:` + error ) ;
8282 return [ ] ;
@@ -92,13 +92,13 @@ export async function rollupBuild(ctx: BuildContext) {
9292 "" ,
9393 `/** @type {import(${ JSON . stringify ( resolvedEntryWithoutExt ) } )} */` ,
9494 `const _module = jiti(null, { interopDefault: true, esmResolve: true })(${ JSON . stringify (
95- resolvedEntry
95+ resolvedEntry ,
9696 ) } );`,
9797 hasDefaultExport ? "\nexport default _module;" : "" ,
9898 ...namedExports
9999 . filter ( ( name ) => name !== "default" )
100100 . map ( ( name ) => `export const ${ name } = _module.${ name } ;` ) ,
101- ] . join ( "\n" )
101+ ] . join ( "\n" ) ,
102102 ) ;
103103
104104 // DTS Stub
@@ -108,10 +108,10 @@ export async function rollupBuild(ctx: BuildContext) {
108108 `export * from ${ JSON . stringify ( resolvedEntryWithoutExt ) } ;` ,
109109 hasDefaultExport
110110 ? `export { default } from ${ JSON . stringify (
111- resolvedEntryWithoutExt
111+ resolvedEntryWithoutExt ,
112112 ) } ;`
113113 : "" ,
114- ] . join ( "\n" )
114+ ] . join ( "\n" ) ,
115115 ) ;
116116
117117 if ( shebang ) {
@@ -138,7 +138,7 @@ export async function rollupBuild(ctx: BuildContext) {
138138 const { output } = await buildResult . write ( outputOptions ) ;
139139 const chunkFileNames = new Set < string > ( ) ;
140140 const outputChunks = output . filter (
141- ( e ) => e . type === "chunk"
141+ ( e ) => e . type === "chunk" ,
142142 ) as OutputChunk [ ] ;
143143 for ( const entry of outputChunks ) {
144144 chunkFileNames . add ( entry . fileName ) ;
@@ -148,7 +148,7 @@ export async function rollupBuild(ctx: BuildContext) {
148148 if ( entry . isEntry ) {
149149 ctx . buildEntries . push ( {
150150 chunks : entry . imports . filter ( ( i ) =>
151- outputChunks . find ( ( c ) => c . fileName === i )
151+ outputChunks . find ( ( c ) => c . fileName === i ) ,
152152 ) ,
153153 modules : Object . entries ( entry . modules ) . map ( ( [ id , mod ] ) => ( {
154154 id,
@@ -170,7 +170,7 @@ export async function rollupBuild(ctx: BuildContext) {
170170 rollupOptions . plugins = rollupOptions . plugins || [ ] ;
171171 // TODO: Use fresh rollup options
172172 const shebangPlugin : any = rollupOptions . plugins . find (
173- ( p ) => p && p . name === "unbuild-shebang"
173+ ( p ) => p && p . name === "unbuild-shebang" ,
174174 ) ;
175175 shebangPlugin . _options . preserve = false ;
176176
@@ -215,7 +215,7 @@ export async function rollupBuild(ctx: BuildContext) {
215215const getChunkFilename = (
216216 ctx : BuildContext ,
217217 chunk : PreRenderedChunk ,
218- ext : string
218+ ext : string ,
219219) => {
220220 if ( chunk . isDynamicEntry ) {
221221 return `chunks/[name].${ ext } ` ;
@@ -229,7 +229,10 @@ export function getRollupOptions(ctx: BuildContext): RollupOptions {
229229 input : Object . fromEntries (
230230 ctx . options . entries
231231 . filter ( ( entry ) => entry . builder === "rollup" )
232- . map ( ( entry ) => [ entry . name , resolve ( ctx . options . rootDir , entry . input ) ] )
232+ . map ( ( entry ) => [
233+ entry . name ,
234+ resolve ( ctx . options . rootDir , entry . input ) ,
235+ ] ) ,
233236 ) ,
234237
235238 output : [
@@ -307,7 +310,7 @@ export function getRollupOptions(ctx: BuildContext): RollupOptions {
307310 ? Object . fromEntries (
308311 ctx . options . rollup . alias . entries . map ( ( entry ) => {
309312 return [ entry . find , entry . replacement ] ;
310- } )
313+ } ) ,
311314 )
312315 : ctx . options . rollup . alias . entries ) ,
313316 } ,
0 commit comments