如何解决Reactide Webpack无法解析模块
我用React
打开了一个Reactide
项目,该项目创建了reactide.config.js
:
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackPluginConfig = new HtmlWebpackPlugin({
filename: 'app.html',chunks: ['app','devServerClient'],template: path.resolve('./app.html'),// Load a custom template
inject: true,})
module.exports = {
entry: './app.jsx',output: {
path: path.resolve(__dirname,'./reactide'),filename: 'bundle.js'
},devServer: {
port: 8085,proxy: [{
context: ['/api'],'target': 'http://localhost:3000',}],},mode: process.env.NODE_ENV,module: {
rules: [
{
test: /\.(jsx|js)$/,loader: 'babel-loader',query: {
presets: ['@babel/react','@babel/preset-env'],compact: false
}
},{
test: /\.scss|css$/,use: [
{
loader: 'css-loader'
},{
loader: 'sass-loader'
}
]
},{
test: /\.(jpeg|jpg|png|gif)$/,use: [
{
loader: 'file-loader',}
]
},{
test: /\.svg$/,use: [
{
loader: 'url-loader',options: {
limit: 999999
}
}
]
}
]
},plugins: [HtmlWebpackPluginConfig],stats: {
colors: true
}
};
现在,我正在使用npm run reactide-server
启动它,它无法解析模块路径,这给了我这种错误:
./shared/utils/constants.js中的错误 找不到模块:错误:无法解析“ / Users / vlasenkona / Desktop / gris-seqr2 / ui / shared / utils”中的“ ../components/form/Inputs” @ ./shared/utils/constants.js 23:14-50 @ ./app.jsx
我已经设置了webpack,但是它们非常复杂,并且跨越多个文件:
https://github.com/macarthur-lab/seqr/tree/master/ui/config
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。