当我尝试启动我的 react-styleguidist 文档时出现以下错误:
./node_modules/react-native-gesture-handler/touchables/TouchableHighlight.js 10:22
Module parse failed: Unexpected token (10:22)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| */
| export default class TouchableHighlight extends Component {
> static defaultProps = {
| ...GenericTouchable.defaultProps,
| activeOpacity: 0.85,
@ ./node_modules/react-native-gesture-handler/touchables/index.js 6:0-69 6:0-69
@ ./node_modules/react-native-gesture-handler/index.js
我的webpack.config.js
样子是这样的:
const createExpoWebpackConfigAsync = require('@expo/webpack-config');
module.exports = async function (env, argv) {
const config = await createExpoWebpackConfigAsync(env, argv);
return config;
};
我的babel.config.js
样子是这样的:
module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
env: {
development: {
plugins: [
'@babel/plugin-transform-react-jsx-source',
],
},
},
};
};
再生产:
git clone https://github.com/kopax/expo-bug-reports.git
cd expo-bug-reports
git checkout react-styleguidist
npm i
npm run styleguide
static
使用关键字的合适的 Webpack 加载器是什么?