Skip to content

Commit bcff3d6

Browse files
committed
#10 Add another option to enable requiring html files inside Angular directives
1 parent 896ad70 commit bcff3d6

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/Webpack/ArgumentsHelper.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ internal class ArgumentsHelper {
88
private const string CssFiles = "--module-bind css=style!css ";
99
private const string LessFiles = "--module-bind less=style!css!less ";
1010
private const string SassFiles = "--module-bind scss=style!css!sass ";
11+
private const string HandleAngularTemplateFiles = "--module-bind html=raw ";
1112
private const string StaticFile = "--module-bind {0}=url?limit={1} ";
1213

1314
/// <summary>
@@ -29,6 +30,9 @@ public static string GetWebpackArguments(string rootPath, WebpackOptions options
2930
result.Append(LessFiles);
3031
}
3132
}
33+
if(options.HandleAngularTemplates) {
34+
result.Append(HandleAngularTemplateFiles);
35+
}
3236
if(options.HandleStaticFiles) {
3337
options.StaticFileTypes.ToList().ForEach(staticFileType => {
3438
result.Append(string.Format(StaticFile, staticFileType.ToString().ToLowerInvariant(), options.StaticFileTypesLimit));

src/Webpack/WebpackOptions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ public WebpackOptions(
5555
/// </summary>
5656
public bool HandleJsxFiles { get; set; }
5757

58+
/// <summary>
59+
/// Indicates if webpack should handle the templates for an Angular application
60+
/// It should be true to use <code>require('template.html')</code> inside directives
61+
/// </summary>
62+
public bool HandleAngularTemplates { get; set; }
63+
5864
/// <summary>
5965
/// Indicates if webpack should handle the static file types through URL and file loader
6066
/// </summary>

0 commit comments

Comments
 (0)