reactjs - React - 错误:找不到所需的文件;在 ../../public 中搜索
问题描述
我正在制作一个 MERN 应用程序,运行后出现上述错误npm start
。我删除了index.html
and public folder
,然后将其替换为client/index.ejs
. 我的webpack.config.js
文件如下所示:
//webpack.config.js
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: './client/index.js',
output: {
path: path.join(__dirname, 'client'),
filename: 'bundle.js'
},
module: {
loaders: [{
test: /.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['es2015', 'react']
}
},
{
test: /\.css$/,
loader: "style-loader!css-loader"
}]
}
}
另外,这是我在 StackOverflow 上的第一篇文章。呜呼!
解决方案
推荐阅读
- forms - 我的网站在 http 上发布表单,但不在 https 上
- python - 如何使用 ffmpeg 将多个显式图像路径连接到视频
- python - 在重叠和非重叠过程中从 3D 图像中提取 3D 补丁并恢复图像
- r - 使用 rcpp 将 R 函数传递给 C 例程
- import - 将 Amazon txt 数据集导入 Neo4j
- c++ - 投射时共享指针不起作用?
- javascript - 设置为显示时显示 HTML 元素:CSS 中无
- p5.js - 如何确保音频在 P5 中的相同点播放?
- c# - 本地定义的枚举标志和枚举定义的标志有什么区别?
- javascript - 从数组中修剪对象中的日期并按最近日期对数组进行排序