【发布时间】:2015-11-26 21:18:51
【问题描述】:
有这个 webpack 配置我正在使用 react-native-webpack-server
var fs = require('fs');
var path = require('path');
var webpack = require('webpack');
var config = {
debug: true,
devtool: 'source-map',
entry: {
'index.ios': ['./src/main.js'],
},
output: {
path: path.resolve(__dirname, 'build'),
filename: '[name].js',
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
query: { stage: 0, plugins: ['./build/babelRelayPlugin'] }
},
],
},
plugins: [],
};
当我导入时
从 'react-native-scrollable-tab-view' 导入 ScrollableTabView;
我明白了
ERROR in ./~/react-native-scrollable-tab-view/index.js
Module parse failed: /Users/butuzgol/Playground/watchme/node_modules/react-native-scrollable-tab-view/index.js Line 135: Unexpected token <
You may need an appropriate loader to handle this file type.
| return React.cloneElement(this.props.renderTabBar(), props);
| } else {
| return <DefaultTabBar {...props} />;
| }
| },
@ ./src/pages/dashboard.js 25:36-79
我也发现了这个问题https://github.com/mjohnston/react-native-webpack-server/issues/34,但目前我还没有找到解决方案
【问题讨论】:
标签: react-native webpack