我创建了这个nodejs脚本,需要phantomjs来访问DOM:
var phantom = require('phantom');
phantom.create(function(ph) {
ph.createPage(function(page) {
page.open("editor3.html", function(status) {
console.log("opened diagram? ", status);
page.evaluate(function() {
return document.getElementById("GraphImage").src;
}, function(result) {
console.log(result)
ph.exit();
});
});
});
},{
dnodeOpts : {
weak : false
}
});
我正在尝试使用webpack来获取javascript代码,但是当我运行此命令时:
webpack ./entry.js bundle.js
我收到此错误: