moeen-basra / laravel-react

Laravel 8 and React 17 boilerplate

Home Page:http://laravel-react.moeen.me/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

missing script build react

ahmdabos opened this issue · comments

i notes there is no build in the secript section in package.json file

 "scripts": {
    "dev": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch-poll": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --watch-poll --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "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",
    "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
  },

i think by default when you create project using create-react-app it should add it there

im asking because i run into issue when i try to run: npm run build
it show: missing script build react

what do you suggest?

I guess npm run production could be used instead.

yes, this work and it show me compiled successfully, and there is a new folder inside public, but I'm confusing now where is the HTML index
untitled

@ahmdabos This line https://github.com/moeen-basra/laravel-react/blob/master/webpack.mix.js#L27 defines where the build output is placed. Basically, project-root: ./public/js and there should be files like vendor.js, app.js in it. As well as chunks directory.

Please remember, this is Laravel application and assets are managed by Laravel-mix tool, and some things could be different than for example with react-scripts.

@ahmdabos I don't like when someone edit own comments. Now it looks like I've answered and unasked question.

@ahmdabos

"...but I'm confusing now where is the HTML index" --> here; this is not a standard SPA, but a Laravel project

commented

@jacekk thats what it exactly is..

This project is only based on laravel and I designed it according to laravel standards.