From dc2a25a4d8e5c7c56c814e40d415421274bf9617 Mon Sep 17 00:00:00 2001 From: Junjie Ding Date: Thu, 18 Jan 2018 16:31:58 +0800 Subject: [PATCH] fix: add child to webpack deps #31,#19 --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index 416414c..1d8e35a 100644 --- a/index.js +++ b/index.js @@ -28,6 +28,10 @@ module.exports = function (source) { var template = ejs.compile(source, opts); + if (template.dependencies.length > 0) { + template.dependencies.map(dep => this.addDependency(dep)); + } + // Beautify javascript code if (!this.minimize && opts.beautify !== false) { var ast = UglifyJS.parse(template.toString());