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.
@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.