我正在material-ui
用于我的网站,并且在其上找到的软件包npm
与其最新版本(在 Github 上找到)已过时。我手动将这行代码添加到他们的主题管理器类中,这反映了更改:
setContentFontFamily(newContentFontFamily) {
if (typeof newContentFontFamily !== "undefined" && newContentFontFamily !== null) {
this.contentFontFamily = newContentFontFamily;
this.component = Extend(this.component, this.template.getComponentThemes(this.palette, this.spacing));
}
},
但是,我的应用程序没有注册这些更改,当我尝试设置字体时:
ThemeManager.setContentFontFamily('Open Sans, Roboto, sans serif');
控制台给了我这个错误:
Uncaught TypeError: ThemeManager.setContentFontFamily is not a function
我正在使用 Browserify 来捆绑我的客户端“需要”依赖项。这是一个 Browserify 问题,一个npm
问题,还是我不理解节点模块是如何工作的?
编辑:这是我的package.json
{
"name": "FooProject",
"version": "0.0.0",
"description": "",
"dependencies": {
"highlight.js": "^8.7.0",
"material-ui": "callemall/material-ui",
"react": "^0.13.3",
"react-bootstrap": "^0.24.5",
"react-highlight": "^0.5.0",
"react-tap-event-plugin": "^0.1.7",
"underscore": "^1.8.3"
},
"author": "Tina Zheng",
"devDependencies": {
"babelify": "^6.1.3",
"bower": "^1.4.1",
"browserify": "^11.0.1",
"gulp": "^3.9.0",
"gulp-react": "^3.0.1",
"gulp-reactify": "^3.0.1"
}
}