node_modules を除外できないため、ここで webpack.config.js の何が問題になっていますか。以前のバージョンの webpack でこの問題に関する同様の投稿を見つけましたが、構文が異なるため、修正は機能しません...
module.exports = {
context: __dirname,
entry: './src/index.js',
output: {
path: __dirname + '/public/assets/',
publicPath: '/assets/js/',
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.css$/,
include: /src/,
exclude: /node_modules/,
use: [
{loader: 'style-loader'},
{loader: 'css-loader'}
]
},
{
test: /\.ejs$/,
include: /src/,
exclude: /node_modules/,
use: [
{loader: 'ejs-simple-loader'}
]
},
{
test: /\.js$/,
include: /src/,
exclude: /node_modules/,
use: [
{loader: 'jshint-loader'}
]
},
{
test: /\.jsx$/,
include: /src/,
exclude: /node_modules/,
use: [
{loader: 'babel-loader'}
]
}
]
}
}