I recently developed Laravel application with React Front end! I need to know how can I create production version of this project!
in the package.json file i see there is option for npm run production
but I dont see any option for composer production build or anything for Laravel. Can someone guide me please. I have read the official documentation it doesn't mention gulp or any other command.
My Package.json File
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"@babel/preset-react": "^7.0.0",
"axios": "^0.19",
"bootstrap": "^4.0.0",
"cross-env": "^5.1",
"jquery": "^3.2",
"laravel-mix": "^4.0.7",
"lodash": "^4.17.13",
"popper.js": "^1.12",
"react": "^16.8.0-alpha.1",
"react-dom": "^16.8.0-alpha.1",
"resolve-url-loader": "^2.3.1",
"sass": "^1.15.2",
"sass-loader": "^7.1.0"
},
"dependencies": {
"@material-ui/core": "^4.5.2",
"@material-ui/icons": "^4.5.1",
"@material-ui/lab": "^4.0.0-alpha.31",
"formik": "^2.0.3",
"react-router": "^5.1.2",
"react-router-dom": "^5.1.2",
"yup": "^0.27.0"
}
}
Gulp is not anymore recommended.
But still, you can find some documentation on Laravel v5.3 : https://laravel.com/docs/5.3/elixir
See on Github the version at the time (package.json
and gulpfile.js
) : https://github.com/laravel/laravel/tree/5.3