Skip to content

Commit

Permalink
#10 Add another option to enable requiring html files inside Angular …
Browse files Browse the repository at this point in the history
…directives
  • Loading branch information
xabikos committed Feb 6, 2016
1 parent 896ad70 commit bcff3d6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Webpack/ArgumentsHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ internal class ArgumentsHelper {
private const string CssFiles = "--module-bind css=style!css ";
private const string LessFiles = "--module-bind less=style!css!less ";
private const string SassFiles = "--module-bind scss=style!css!sass ";
private const string HandleAngularTemplateFiles = "--module-bind html=raw ";
private const string StaticFile = "--module-bind {0}=url?limit={1} ";

/// <summary>
Expand All @@ -29,6 +30,9 @@ public static string GetWebpackArguments(string rootPath, WebpackOptions options
result.Append(LessFiles);
}
}
if(options.HandleAngularTemplates) {
result.Append(HandleAngularTemplateFiles);
}
if(options.HandleStaticFiles) {
options.StaticFileTypes.ToList().ForEach(staticFileType => {
result.Append(string.Format(StaticFile, staticFileType.ToString().ToLowerInvariant(), options.StaticFileTypesLimit));
Expand Down
6 changes: 6 additions & 0 deletions src/Webpack/WebpackOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ public WebpackOptions(
/// </summary>
public bool HandleJsxFiles { get; set; }

/// <summary>
/// Indicates if webpack should handle the templates for an Angular application
/// It should be true to use <code>require('template.html')</code> inside directives
/// </summary>
public bool HandleAngularTemplates { get; set; }

/// <summary>
/// Indicates if webpack should handle the static file types through URL and file loader
/// </summary>
Expand Down

0 comments on commit bcff3d6

Please sign in to comment.