From d4526ffa2e672ae8e49c954798ab9c08eb982560 Mon Sep 17 00:00:00 2001 From: volvl Date: Thu, 30 May 2024 13:32:01 +0400 Subject: [PATCH] =?UTF-8?q?Ge=D0=B5=20app=20bootstrap=20string=20using=20a?= =?UTF-8?q?=20regex=20(#890)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../devextreme-cli/src/applications/application.angular.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/devextreme-cli/src/applications/application.angular.js b/packages/devextreme-cli/src/applications/application.angular.js index f8ef4be75..48d762f70 100644 --- a/packages/devextreme-cli/src/applications/application.angular.js +++ b/packages/devextreme-cli/src/applications/application.angular.js @@ -128,7 +128,8 @@ const changeMainTs = (appPath) => { moduleWorker.insertImport(filePath, 'devextreme/ui/themes', 'themes', true); const fileContent = fs.readFileSync(filePath).toString(); - const firstChaptStr = 'platformBrowserDynamic().bootstrapModule(AppModule)'; + const bootstrapPattern = /platformBrowserDynamic\(\)\.bootstrapModule\(\s*AppModule\s*(?:,\s*\{[^}]*\})?\s*\)/; + const firstChaptStr = fileContent.match(bootstrapPattern)[0]; const lastChaptStr = '.catch(err => console.error(err));'; fs.writeFileSync(