13
我想require
與browserify使用變量傳遞給函數的文件:要求在browserify不起作用變量名
var playersOptions = {
name: 'players',
ajax: 'team-overview',
route: {
name: 'overview',
path: 'playersOverview',
url: 'playersoverview'
}
};
var BackboneView = require(playersOptions.route.path);
//Error: Uncaught Error: Cannot find module 'playersOverview'
var BackboneView = require('playersOverview');
//Requires the file without any problems.
我很困惑,爲什麼會失敗?如何在兩個字符串都找不到模塊?
Arghhh你血腥的天才!這真是太好了! 'Logic' :) – 2014-10-17 22:28:28