In Laravel 5.3 the package.json file looks as following: all packages are in devDependencies. Do somebody can tell me which packages are needed in production too. I think all except browsersync.
package.json
{
"private": true,
"scripts": {
"prod": "gulp --production",
"dev": "gulp watch"
},
"devDependencies": {
"gulp": "^3.9.1",
"jquery": "^3.1.0",
"laravel-elixir": "^6.0.0-9",
"laravel-elixir-browsersync-official": "^1.0.0",
"laravel-elixir-vue-2": "^0.2.0",
"laravel-elixir-webpack-official": "^1.0.2",
"lodash": "^4.16.2",
"vue": "^2.0.1",
"vue-resource": "^1.0.3"
},
"dependencies": {
"dropzone": "^4.3.0"
}
}
I think some packages like vue.js are also needed in production mode so I would move them to dependencies and not devDependencies.
All of those are
devDependenciesif you are usingelixir:Firstly, you don't need
elixirin production because it's just a wrapper forgulp, hopefully, you will compile your assets on your development machine and upload them.All other npm javascript libraries can be compiled with
elixir, so there is no need to have them on the production machine. By defaultelixiruseswebpackto compileresources\assets\js\app.jsintopublic\js\app.jswhich you need to include in your webpages as ascript.If you take a look at:
resources\assets\js\bootstrap.jsyou will see the packages thatlaraveladds by default (things likevue,bootstrapandjQuery), so if, for example you want to adddropzoneto your project you simply add it tobootstrap.jslike so:require('dropzone');Which would now compile
dropzonetopublic\js\app.jsmakingdropzoneadevDependencyalso.