0
我正在尝试为流星打包material-ui反应npm模块,但总是得到jsx文件中包含的jsx标记的错误。如何在流星中加载非js文件的npm模块
material-ui/src/js/app-bar.jsx:31
W20141121-19:42:18.097(1)? (STDERR) if (this.props.title) title = <h1 className="mui- app-bar-title">{this.prop
W20141121-19:42:18.097(1)? (STDERR) ^
W20141121-19:42:18.098(1)? (STDERR) SyntaxError: Unexpected token <
jsx文件必须在被流星收集之前进行预处理。 Meteor通过Package.registerBuildPlugin提供包含在项目中的文件的预处理,但是如何在打包npm模块时做到这一点?我package.js看起来像这样
Npm.depends({
"material-ui": "0.3.0"
})
Package.onUse(function(api) {
api.versionsFrom('1.0');
api.use('jhartma:[email protected]', ['client','server']);
api.addFiles('plugin/index.js',['server','client'])
});
检查[材料UI(https://atmospherejs.com/izzilab/material- ui)使用Meteor的material-ui。 – Season 2015-09-28 05:00:27