Я создаю приложение MERN и получаю вышеуказанную ошибку после запуска npm start
. Я удалил index.html
и 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. Woohoo!