0

Can anybody tell me if it is possible to create one js file (like build version ) of one react component and all its imported plugins so that I can use that js file in my HTML page? like one .js file for the Home component with all the dependent files. like one .js file for the About component with all the dependent files.

  • Does this answer your question? [Generate single physical javascript file using create-react-app](https://stackoverflow.com/questions/49123097/generate-single-physical-javascript-file-using-create-react-app) – k-wasilewski Feb 10 '21 at 16:51
  • Thank you for your quick response. but my requirement is to create one js file for one react component with all dependent files. ex. home component > home.js file (with all imported files) about component > about.js file (with all imported files) so that I can use that generated js file in our simple HTML page. – Arjun Singh Feb 10 '21 at 18:29
  • So why is it a problem to create and then build an app with just one component rendered into some html element? – k-wasilewski Feb 10 '21 at 19:38
  • Hi @k-wasilewski if we generate build with `npm run build` it will generate a js file for the whole project but I don't want that. what I want is to generate a vanilla js file of one Component with all the dependency so that I can integrate that in a simple HTML page just by adding that script through – Arjun Singh Feb 11 '21 at 04:27

0 Answers0