报错忘记截图了……
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, './');
留问