in package.json file as follows.
add GENERATE_SOURCEMAP=false to build
scripts: {
"build": "GENERATE_SOURCEMAP=false react-scripts build"
}
"build": "GENERATE_SOURCEMAP=false react-scripts build",
"winBuild": "set "GENERATE_SOURCEMAP=false" && react-scripts build",
Use npm run build for creating build on Linux.
Use npm run winBuild for creating build on Windows.
import React, { useState } from 'react';
const Component = () => {
const [show, setShow] = useState(false);
return(
<>
<button onClick={() => setShow(prev => !prev)}>Click</button>
{show && <Box>This is your component</Box>}
</>
);
}
export default Component
In in package.json (Windows)
"scripts": {
...
"cleanBuild": "rimraf ./build/*",
"build": "npm run cleanBuild && set "GENERATE_SOURCEMAP=false" && react-scripts build ",
in package.json file as follows.
add GENERATE_SOURCEMAP=false to build
scripts: {
"build": "GENERATE_SOURCEMAP=false react-scripts build"
}
"build": "GENERATE_SOURCEMAP=false react-scripts build",
"winBuild": "set "GENERATE_SOURCEMAP=false" && react-scripts build",
Use npm run build for creating build on Linux.
Use npm run winBuild for creating build on Windows.
import React, { useState } from 'react';
const Component = () => {
const [show, setShow] = useState(false);
return(
<>
<button onClick={() => setShow(prev => !prev)}>Click</button>
{show && <Box>This is your component</Box>}
</>
);
}
export default Component
In in package.json (Windows)
"scripts": {
...
"cleanBuild": "rimraf ./build/*",
"build": "npm run cleanBuild && set "GENERATE_SOURCEMAP=false" && react-scripts build ",