diff --git a/lib/build/find-deps.js b/lib/build/find-deps.js index 851d7fff5..e04f4095a 100644 --- a/lib/build/find-deps.js +++ b/lib/build/find-deps.js @@ -266,7 +266,7 @@ exports.findHtmlDeps = function(filename, contents, loaderType = 'require') { let parser = new htmlparser.Parser({ onopentag: function(name, attrs) { // - if (name === 'require' && attrs.from) { + if ((name === 'require' || name === 'import') && attrs.from) { add(auDep(attrs.from, loaderType)); // // diff --git a/spec/lib/build/find-deps.spec.js b/spec/lib/build/find-deps.spec.js index b02f2a25b..eb12ababd 100644 --- a/spec/lib/build/find-deps.spec.js +++ b/spec/lib/build/find-deps.spec.js @@ -26,6 +26,7 @@ let html = ` `; -let htmlDeps = ['a/b', 'lv1', 'lv2', 'lvm2', 'text!./c.html', 'text!d/e.css', 'v2', 'vm1', 'vm2']; -let htmlDepsSystemJS = ['./c.html!text', 'a/b', 'd/e.css!text', 'lv1', 'lv2', 'lvm2', 'v2', 'vm1', 'vm2']; +let htmlDeps = ['a/b', 'lv1', 'lv2', 'lvm2', 'text!./c.html', 'text!./from-import.html', 'text!d/e.css', 'v2', 'vm1', 'vm2']; +let htmlDepsSystemJS = ['./c.html!text', './from-import.html!text', 'a/b', 'd/e.css!text', 'lv1', 'lv2', 'lvm2', 'v2', 'vm1', 'vm2']; let css = ` @import 'other.css';