Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

update AMD depes Regex

  • Loading branch information...
commit 21064d5de866ea7c773262c1376724b880be1862 1 parent f0eb465
@chaozhang authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/inject.coffee
View
4 src/inject.coffee
@@ -71,7 +71,7 @@ commentRegex = null
requireRegex = /(?:^|[^\w\$_.])require\s*\(\s*("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')\s*\)/g;
// requireEnsureRegex = /(?:^|[^\w\$_.])require.ensure\s*\(\s*(\[("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*'|\s*|,)*\])/g;
// define static requirements
-defineStaticRequireRegex = /^.*define\([^\[]*\[([^\]]*)\],.+/;
+defineStaticRequireRegex = /^.*define\(\s*("\S+",|'\S+',|\s*)\s*\[([^\]]*)\],\s*(function\s*\(|{).+/;
// commentRegex from RequireJS
commentRegex = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg;
`
@@ -826,7 +826,7 @@ extractRequires = (file) ->
# get static requirements
staticReqs = []
if defineStaticRequireRegex.exec(file)
- staticReqs = defineStaticRequireRegex.exec(file)[1].replace(/\s|"|'|require|exports|module/g,'').split(',');
+ staticReqs = defineStaticRequireRegex.exec(file)[2].replace(/\s|"|'|require|exports|module/g,'').split(',');
for staticReq in staticReqs
requires.push(staticReq) if uniques[staticReq] isnt true and staticReq isnt ''
Please sign in to comment.
Something went wrong with that request. Please try again.