最后,我明白了。
答案很简单:
material-ui
通过npm 安装:npm install material-ui --save
- 添加
resolve.moduleDirectories
,resolve.extensions
- 打开和声模式中
jsx-loader
通过jsx-loader?harmony
我最终得到了webpack.config.js:
var config = { entry: { Messenger: './app/Messenger.jsx', AppComponent: './app/AppComponent.jsx' }, resolve: { modulesDirectories: ['node_modules'], alias: {}, extensions: ['', '.jsx', '.js'] }, output: { path: './www', filename: '[name].bundle.js' }, module: { noParse: [], loaders: [ { test: /.css$/, loader: 'style-loader!css-loader' }, // use ! to chain loaders { test: /.png$/, loader: "url-loader?limit=100000&mimetype=image/png" }, { test: /.jsx$/, loader: 'jsx-loader?harmony' } ] }};module.exports = config;
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)