angular-hmr-loader
angular-hmr-loader copied to clipboard
[BUG] Does not match bootstrapModule if it contains multiline compilerOptions
Line index.js#L3 will not match multiline compilerConfig.
.bootstrapModule(AppModule, {
defaultEncapsulation: ViewEncapsulation.None,
})
will match
.bootstrapModule(AppModule, { defaultEncapsulation: ViewEncapsulation.None })
Could you update the RegExp to reflect the angular documentation?
This might work, but needs testing with nested config objects that look similar.
/(\.bootstrapModule|\.bootstrapModuleFactory)\((.+|.+, ?[\[\{][\S\s]*[\]\}])?\)/gm
But a better solution would be to loop though and count opening / closing brackets.
can you make a PR and provide a link to regex101.com with examples