You will find plenty of answers from Laracasts discussion if you search with devDependencies. If you use Laravel Mix or Webpack in other way, it doesn't matter, all dependencies your Javascript is using is going to be in the bundle file provided to browser. Some developers like to separate dependencies which really are only for development stages, like webpack loaders, to devDependencies and and others put all in devDependencies because in the case of Webpack they are used in development only, in production there is only bundle files.
Understanding Package.Json
Below is dependencies in package.json file on my development server for a project. So basically these generates a package-lock.json which I have to commit on production server and which will install same dependencies on it.
Will the dependencies mentioned in "devDependencies" be included on production server? I guess no. If so then it means before I move project to production server I have to move/copy dependencies from "devDependencies" to "dependencies" and update the package-lock.json.
Please correct If my understanding is not correct and If there is any reference article which tells the correct procedure or steps for using the node packages from development to production.
"devDependencies": {
"axios": "^0.18.1",
"cross-env": "^5.1",
"laravel-mix": "^4.0.15",
"lodash": "^4.17.15",
"resolve-url-loader": "^2.3.1",
"sass": "^1.15.2",
"sass-loader": "^7.1.0",
"vue-template-compiler": "^2.6.10"
},
"dependencies": {
"laravel-echo": "^1.6.1",
"pusher-js": "^5.0.2",
"vue": "^2.6.10"
}
Please or to participate in this conversation.