为什么 gulp 在 Laravel 6 中不适用于生产版本?
Why is gulp not available in Laravel 6 for production version?
我最近用 React Front end 开发了 Laravel 应用程序!我需要知道如何创建该项目的生产版本!
在 package.json 文件中,我看到有 npm run production
的选项,但我没有看到作曲家生产构建的任何选项或 Laravel 的任何选项。有人可以指导我吗?我读过 official documentation 它没有提到 gulp 或任何其他命令。
我的Package.json文件
{
"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不再推荐。
但是,您仍然可以在 Laravel v5.3 上找到一些文档:https://laravel.com/docs/5.3/elixir
查看 Github 当时的版本(package.json
和 gulpfile.js
):https://github.com/laravel/laravel/tree/5.3
我最近用 React Front end 开发了 Laravel 应用程序!我需要知道如何创建该项目的生产版本!
在 package.json 文件中,我看到有 npm run production
的选项,但我没有看到作曲家生产构建的任何选项或 Laravel 的任何选项。有人可以指导我吗?我读过 official documentation 它没有提到 gulp 或任何其他命令。
我的Package.json文件
{
"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不再推荐。
但是,您仍然可以在 Laravel v5.3 上找到一些文档:https://laravel.com/docs/5.3/elixir
查看 Github 当时的版本(package.json
和 gulpfile.js
):https://github.com/laravel/laravel/tree/5.3