2025-02-20T09:20:27.0519522Z > [email protected] build
2025-02-20T09:20:27.0520079Z > npm run migrate && webpack --config webpack.prod.js
2025-02-20T09:20:27.0521155Z
2025-02-20T09:20:29.0825668Z
2025-02-20T09:20:29.0838195Z > [email protected] migrate
2025-02-20T09:20:29.0838877Z > npx sequelize-cli db:migrate
2025-02-20T09:20:29.0839675Z
2025-02-20T09:20:36.2886604Z
2025-02-20T09:20:36.2887992Z [4mSequelize CLI [Node: 16.18.1, CLI: 6.6.2, ORM: 6.37.5][24m
2025-02-20T09:20:36.2888730Z
2025-02-20T09:20:36.3267065Z Loaded configuration file "server/db/config.json".
2025-02-20T09:20:36.3267758Z Using environment "production".
2025-02-20T09:20:40.1777294Z No migrations were executed, database schema was already up to date.
2025-02-20T09:20:42.4559654Z [webpack-cli] TypeError: Cannot read properties of undefined (reading 'getArguments')
2025-02-20T09:20:42.4560664Z at WebpackCLI.getBuiltInOptions (/var/www/html/litpath/litpath-dev/code/node_modules/webpack-cli/lib/webpack-cli.js:831:77)
2025-02-20T09:20:42.4562402Z at makeCommand.options.entry (/var/www/html/litpath/litpath-dev/code/node_modules/webpack-cli/lib/webpack-cli.js:939:33)
2025-02-20T09:20:42.4563728Z at async WebpackCLI.makeCommand (/var/www/html/litpath/litpath-dev/code/node_modules/webpack-cli/lib/webpack-cli.js:443:31)
2025-02-20T09:20:42.4566602Z at async loadCommandByName (/var/www/html/litpath/litpath-dev/code/node_modules/webpack-cli/lib/webpack-cli.js:937:17)
2025-02-20T09:20:42.4571521Z at async Command. (/var/www/html/litpath/litpath-dev/code/node_modules/webpack-cli/lib/webpack-cli.js
2025-02-20T09:20:42.4572305Z at async Command.parseAsync (/var/www/html/litpath/litpath-dev/code/node_modules/webpack-cli/node_modules/commander/lib/command.js:935:5)
2025-02-20T09:20:42.4573019Z at async WebpackCLI.run (/var/www/html/litpath/litpath-dev/code/node_modules/webpack-cli/lib/webpack-cli.js
2025-02-20T09:20:42.4574822Z at async runCLI (/var/www/html/litpath/litpath-dev/code/node_modules/webpack-cli/lib/bootstrap.js:9:9)
< /code>
мои зависимости: (я использую узел 16.x на моем сервере развертывания, и локально это 20.x) < /p>
"webpack": "^5.92.1",
"webpack-cli": "^5.1.4",
С этой конфигурацией моя сборка успешна, но при запуске приложения в запуске она не удалась. Br />const merge = require('webpack-merge')
const webpack = require('webpack')
const TerserPlugin = require('terser-webpack-plugin')
const BrotliPlugin = require('brotli-webpack-plugin')
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
const common = require('./webpack.common')
module.exports = () => {
return merge(common, {
optimization: {
splitChunks: {
chunks: 'all',
},
minimize: true,
minimizer: [new TerserPlugin()],
},
devtool: 'source-map',
mode: 'production',
// https://webpack.js.org/plugins/define-plugin/
// babel-minify-webpack look
plugins: [
new webpack.DefinePlugin({
REACT_APP_SERVER_URL: JSON.stringify(process.env.BASE_URL),
}),
new BrotliPlugin({
asset: '[path].br[query]',
test: /\.(js|css|html|svg)$/,
threshold: 10240,
minRatio: 0.8,
}),
new NodePolyfillPlugin(),
],
})
}
< /code>
my webpack.dev.js: < /p>
const path = require('path')
const merge = require('webpack-merge')
const webpack = require('webpack')
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
const common = require('./webpack.common')
module.exports = () => {
// location and env are `development` by default
// https://webpack.js.org/plugins/define-plugin/
return merge(common, {
mode: 'development',
devtool: 'inline-source-map',
devServer: {
static: path.join(__dirname, 'dist'),
compress: true,
host: 'localhost',
port: 3000,
historyApiFallback: true,
// https://webpack.js.org/configuration/de ... erverproxy
proxy: [
{
context: ['/auth', '/api'],
target: 'http://localhost:3001',
secure: false,
},
],
},
plugins: [
new webpack.DefinePlugin({
REACT_APP_SERVER_URL: JSON.stringify('http://localhost:3001'),
}),
new NodePolyfillPlugin(),
],
})
}
Подробнее здесь: https://stackoverflow.com/questions/794 ... etargument