MCPcopy
hub / github.com/adonisjs/core / updateRcFile

Method updateRcFile

modules/ace/codemods.ts:315–332  ·  view source on GitHub ↗

* Update the adonisrc.ts file with new configuration settings. * This method allows modification of the AdonisJS runtime configuration. * * @param params - Parameters for updating the RC file (varies based on update type) * * @example * ```ts * await codemods.updateRcFile((rcFil

(...params: Parameters<CodeTransformer['updateRcFile']>)

Source from the content-addressed store, hash-verified

313 * ```
314 */
315 async updateRcFile(...params: Parameters<CodeTransformer['updateRcFile']>) {
316 const transformer = await this.#getCodeTransformer()
317 if (!transformer) {
318 this.#cliLogger.warning(
319 'Cannot update "adonisrc.ts" file. Install "@adonisjs/assembler" to modify source files'
320 )
321 return
322 }
323
324 const action = this.#cliLogger.action('update adonisrc.ts file')
325 try {
326 await transformer.updateRcFile(...params)
327 action.succeeded()
328 } catch (error: any) {
329 this.emit('error', error)
330 action.failed(error.message)
331 }
332 }
333
334 /**
335 * Register a new Vite plugin in the vite.config.ts file.

Callers 5

#configureVineJSMethod · 0.80
#configureEdgeMethod · 0.80
runMethod · 0.80
runMethod · 0.80
codemods.spec.tsFile · 0.80

Calls 1

#getCodeTransformerMethod · 0.95

Tested by

no test coverage detected