Skip to content

Commit d4526ff

Browse files
Geе app bootstrap string using a regex (#890)
1 parent ee61248 commit d4526ff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/devextreme-cli/src/applications/application.angular.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ const changeMainTs = (appPath) => {
128128
moduleWorker.insertImport(filePath, 'devextreme/ui/themes', 'themes', true);
129129

130130
const fileContent = fs.readFileSync(filePath).toString();
131-
const firstChaptStr = 'platformBrowserDynamic().bootstrapModule(AppModule)';
131+
const bootstrapPattern = /platformBrowserDynamic\(\)\.bootstrapModule\(\s*AppModule\s*(?:,\s*\{[^}]*\})?\s*\)/;
132+
const firstChaptStr = fileContent.match(bootstrapPattern)[0];
132133
const lastChaptStr = '.catch(err => console.error(err));';
133134

134135
fs.writeFileSync(

0 commit comments

Comments
 (0)