Skip to content

Commit

Permalink
Geе app bootstrap string using a regex (#890)
Browse files Browse the repository at this point in the history
  • Loading branch information
dxvladislavvolkov authored May 30, 2024
1 parent ee61248 commit d4526ff
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit d4526ff

Please sign in to comment.