allow a["b"] = require(...) in bundler
This commit is contained in:
parent
5552ef31b1
commit
c3d856e139
2 changed files with 27 additions and 1 deletions
|
|
@ -20,7 +20,7 @@ function run(input, output) {
|
|||
var modules = {}
|
||||
var bindings = {}
|
||||
var declaration = /^\s*(?:var|let|const|function)[\t ]+([\w_$]+)/gm
|
||||
var include = /(?:((?:var|let|const|,|)[\t ]*)([\w_$\.]+)(\s*=\s*))?require\(([^\)]+)\)(\s*[`\.\(\[])?/gm
|
||||
var include = /(?:((?:var|let|const|,|)[\t ]*)([\w_$\.\[\]"'`]+)(\s*=\s*))?require\(([^\)]+)\)(\s*[`\.\(\[])?/gm
|
||||
var uuid = 0
|
||||
var process = function(filepath, data) {
|
||||
data.replace(declaration, function(match, binding) {bindings[binding] = 0})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue