Skip to content

Commit

Permalink
BUG: will skip external sources
Browse files Browse the repository at this point in the history
  • Loading branch information
okdistribute committed Mar 22, 2015
1 parent aaa30cb commit 73455ee
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = function(opts) {
opts.basedir = opts.basedir || process.cwd()
opts.selector = opts.selector || 'script[type="text/browserify"]'
opts.args = opts.args || []

var html = ''
return through(write, end)

Expand All @@ -28,7 +28,13 @@ module.exports = function(opts) {
var script = $(scripts[at])
var entry = script.text()
var src = script.attr('src')
if (src) entry = fs.readFileSync(path.join(opts.basedir, src)).toString()
if (src) {
if (!fs.existsSync(src)) {
at++
return done()
}
entry = fs.readFileSync(src).toString()
}
bfy(entry, opts.args, function(text) {
script.attr('type', 'text/javascript')
script.attr('src', null)
Expand Down

0 comments on commit 73455ee

Please sign in to comment.