adnan khan
adnan khan

Reputation: 101

React how can I build minify code in react library

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?

Upvotes: 1

Views: 6272

Answers (1)

S. Hesam
S. Hesam

Reputation: 6743

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.

Upvotes: 1

Related Questions