Support the ongoing development of Laravel.io →
posted 5 years ago
Last updated 2 years ago.
0

I also learnt how to use webpack to compile, minimize etc. my js and css files in a pure react-js application, would love to learn to do the same with Laravel.

    "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"
    },

What's the best way and workflow to use these commands?

0

why are there both NodeJS and Composer dependencies?

It is because Laravel is a solution for both Frontend (css/js) and backend (php) NodeJS - is for managing your frontend dependencies (css/js) Composer - is for managing your backend dependencies

I also have node dependencies which I can't understand why, or where those are used

it is meant for local development environment when developing your UI, most of the cool kids nowadays uses ReactJS, Vue, Angular etc. instead of Blade Templates. And to use those you need those dependencies in order to transpile, minify, bundle etc, look at https://laravel.com/docs/5.8/mix for more info on the workflow

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.