我使用后:
npm run build
Run Code Online (Sandbox Code Playgroud)
i got this error:

My webpack.config.js:
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin')
const CopyPlugin = require('copy-webpack-plugin');
module.exports = {
module: {
rules: [
{ test: /\.js$/, exclude: /node_modules/, loader: "babel-loader" },
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
]
},
entry: './app/game/index.js',
output: {
filename: 'main.js',
path: __dirname + "/src/main/resources/static"
},
plugins: [
new HtmlWebpackPlugin(),
new CopyPlugin([
{ from: './app/assets', to: './assets' },
])
]
};
Run Code Online (Sandbox Code Playgroud)
My IdeaProjects\Flood\flood-project\app\game\index.js :
import MainMenu from './main-menu';
import …Run Code Online (Sandbox Code Playgroud)