Closed WalterZou closed 7 years ago
var IS_TEST = !!process.env.VUE_LOADER_TEST
var fs = require('fs')
var path = require('path')
var hasWeexLoader = false
try {
hasWeexLoader = !!require('weex-loader')
} catch (e) {}
exports.lib = function (file) {
if (hasWeexLoader) {
return 'weex-loader/node_modules/weex-vue-loader/lib/' + file
}
if (IS_TEST) {
return path.resolve(__dirname, file)
} else {
return 'weex-vue-loader/lib/' + file
}
}
exports.dep = function (dep) {
if (hasWeexLoader) {
return 'weex-loader/node_modules/weex-vue-loader/node_modules/' + dep
}
if (IS_TEST) {
return dep
} else if (fs.existsSync(path.resolve(__dirname, '../node_modules', dep))) {
// npm 2 or npm linked
return 'weex-vue-loader/node_modules/' + dep
} else {
// npm 3
return dep
}
}
seems like hasWeexLoader
might not be needed for weex-loader@0.4.1? same issue was reported here: https://github.com/weexteam/weex-hackernews/issues/4
fixed in weex-vue-loader@0.2.4
on which weex-loader
depends.
please re-install weex-loader
.
thanks.
When I ran
npm run build
with weex-hackernews, it threw this error :Actually, tha path
weex-loader/node_modules/
didn't exist