Permalink
Browse files

fixed regex to pull dependencies out of defined module

  • Loading branch information...
1 parent 094b893 commit 52c8552846705f19b37d265508924fbd6aaf9a82 @bobpace committed Mar 22, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/FubuMVC.HelloWorld/RequireJsAssetPrecompiler.cs
@@ -10,7 +10,7 @@ namespace FubuMVC.HelloWorld
public class RequireJsAssetPrecompiler : IAssetPrecompiler
{
readonly IFileSystem _fileSystem;
- readonly Regex _regex = new Regex(@"^(?:define|require)\((?:\"".*\"",)?(\[([\""']).*?\2\])");
+ readonly Regex _regex = new Regex(@"^(?:define|require)\((?:([\""']).*?\1,\s*)?(\[([\""']).*?\3\])");
readonly string[] _replacements = new[] {"\"", "'", " ", "[", "]"};
public RequireJsAssetPrecompiler(IFileSystem fileSystem)
@@ -28,7 +28,7 @@ public void Precompile(IAssetPipeline pipeline, IAssetRegistration registration)
var match = _regex.Match(content);
if (match.Success)
{
- var dependencies = match.Groups[1].Value;
+ var dependencies = match.Groups[2].Value;
dependencies = _replacements
.Aggregate(dependencies, (current, value) => current.Replace(value, ""));
var assets = dependencies.Split(',');

0 comments on commit 52c8552

Please sign in to comment.