1- /* eslint-disable @typescript-eslint/explicit-function-return-type */
2-
31import { existsSync } from "node:fs" ;
42import { join } from "node:path" ;
53import { fileURLToPath } from "node:url" ;
@@ -122,7 +120,7 @@ export default async args => {
122120 postCssPlugin ( outputFormat , production ) ,
123121 alias ( {
124122 entries : {
125- "react-hot-loader/root" : fileURLToPath ( new URL ( "hot" , import . meta. url ) ) ,
123+ "react-hot-loader/root" : fileURLToPath ( new URL ( "hot" , import . meta. url ) )
126124 }
127125 } ) ,
128126 ...getCommonPlugins ( {
@@ -199,7 +197,7 @@ export default async args => {
199197 setTimeout ( ( ) => process . exit ( 0 ) ) ;
200198 }
201199 } ,
202- name : ' force-close'
200+ name : " force-close"
203201 }
204202 ] ,
205203 onwarn : onwarn ( args )
@@ -208,10 +206,11 @@ export default async args => {
208206
209207 const customConfigPathJS = join ( sourcePath , "rollup.config.js" ) ;
210208 const customConfigPathESM = join ( sourcePath , "rollup.config.mjs" ) ;
211- const existingConfigPath =
212- existsSync ( customConfigPathJS ) ? customConfigPathJS
213- : existsSync ( customConfigPathESM ) ? customConfigPathESM
214- : null ;
209+ const existingConfigPath = existsSync ( customConfigPathJS )
210+ ? customConfigPathJS
211+ : existsSync ( customConfigPathESM )
212+ ? customConfigPathESM
213+ : null ;
215214 if ( existingConfigPath != null ) {
216215 const customConfig = await loadConfigFile ( existingConfigPath , { ...args , configDefaultConfig : result } ) ;
217216 customConfig . warnings . flush ( ) ;
@@ -225,12 +224,12 @@ export default async args => {
225224 nodeResolve ( { preferBuiltins : false , mainFields : [ "module" , "browser" , "main" ] } ) ,
226225 isTypescript
227226 ? typescript ( {
228- noEmitOnError : ! args . watch ,
229- sourceMap : config . sourceMaps ,
230- inlineSources : config . sourceMaps ,
231- target : "es2022" , // we transpile the result with babel anyway, see below
232- exclude : [ "**/__tests__/**/*" ]
233- } )
227+ noEmitOnError : ! args . watch ,
228+ sourceMap : config . sourceMaps ,
229+ inlineSources : config . sourceMaps ,
230+ target : "es2022" , // we transpile the result with babel anyway, see below
231+ exclude : [ "**/__tests__/**/*" ]
232+ } )
234233 : null ,
235234 // Babel can transpile source JS and resulting JS, hence are input/output plugins. The good
236235 // practice is to do the most of conversions on resulting code, since then we ensure that
@@ -267,29 +266,29 @@ export default async args => {
267266 } ) ,
268267 config . transpile
269268 ? getBabelOutputPlugin ( {
270- sourceMaps : config . sourceMaps ,
271- babelrc : false ,
272- compact : false ,
273- ...( config . babelConfig || { } )
274- } )
269+ sourceMaps : config . sourceMaps ,
270+ babelrc : false ,
271+ compact : false ,
272+ ...( config . babelConfig || { } )
273+ } )
275274 : null ,
276275 image ( ) ,
277276 production ? terser ( ) : null ,
278277 config . licenses
279278 ? license ( {
280- thirdParty : {
281- includePrivate : true ,
282- output : [
283- {
284- file : join ( outDir , "dependencies.txt" )
285- } ,
286- {
287- file : join ( outDir , "dependencies.json" ) ,
288- template : licenseCustomTemplate
289- }
290- ]
291- }
292- } )
279+ thirdParty : {
280+ includePrivate : true ,
281+ output : [
282+ {
283+ file : join ( outDir , "dependencies.txt" )
284+ } ,
285+ {
286+ file : join ( outDir , "dependencies.json" ) ,
287+ template : licenseCustomTemplate
288+ }
289+ ]
290+ }
291+ } )
293292 : null ,
294293 // We need to create .mpk and copy results to test project after bundling is finished.
295294 // In case of a regular build is it is on `writeBundle` of the last config we define
0 commit comments