私はmaterial-ui
自分のウェブサイトに使用していますが、見つかったパッケージnpm
は最新バージョン (Github にあります) では古くなっています。このコード行を、変更を反映する Theme Manager クラスに手動で追加しました。
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"
}
}