superset前端项目无法启动,报错jsx中有无法解析的token,没有合适的

报错忘记截图了……

You may need an appropriate loader to handle this file type, currently no loader …

大致意思就是,没有合适的loader去加载这类文件,报错集中在src目录下的jsx文件中。

解决:

webpack.config.js文件,include中添加src目录

{
    test: /\.jsx?$/,
    // include source code for plugins, but exclude node_modules and test files within them
    exclude: [/superset-ui.*\/node_modules\//, /\.test.jsx?$/],
    include: [
        new RegExp(`${APP_DIR}/src`),      // 按理这句就已经添加了
        /superset-ui.*\/src/,
        new RegExp(`${APP_DIR}/.storybook`),
        path.resolve(__dirname, './src')   // 此处添加src目录
    ],
    use: [babelLoader],
},

这个是已经运行中的项目,按理说上面那句已经添加了src目录,但是不明白为什么不能识别。

// 这是APP_DIR的定义
const APP_DIR = path.resolve(__dirname, './');

留问

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值