1

I have an issue with React Js app; how should I build minified code of my React code.

Code Structure

My Code File

I run my react app with npm start

What should I do next to build minified files.

'build/static/js/main.d3cd729d.js'
'build/static/css/main.9b99bc40.css'

Does anyone help?

8
  • You need to setup bundler like webpack i hope you are already using this. You checkout the webpack docs for building minified bundles Commented May 8, 2020 at 13:10
  • how you have created the app? Have you created with npx create-react-app or setup with webpack? Commented May 8, 2020 at 13:11
  • what command i will run in my react app @panther Commented May 8, 2020 at 13:12
  • npm install -g create-react-app to create new app @sonu Commented May 8, 2020 at 13:14
  • medium.com/@rajaraodv/… - Look at this article from Medium Commented May 8, 2020 at 13:14

1 Answer 1

1

If in your package.json file, these two scripts are exist

"scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    }

Then you can use the npm run build command to minify your react app code.

Sign up to request clarification or add additional context in comments.

1 Comment

ok let me try npm run build @s-hesam

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.