Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to render HTML/CSS/JS in /public/index.html on build? #4172

Closed
dmitrizzle opened this issue Mar 18, 2018 · 1 comment
Closed

Comments

@dmitrizzle
Copy link

dmitrizzle commented Mar 18, 2018

  • At minimum, I'm looking for a way to import CSS into index.html that could be rendered on build (i.e. sanitize.css from NPM or https://github.com/KyleAMathews/typefaces CSS package). Is there a way to do this and have it minified on build?
  • Is there a way to do the same with JavaScript AND have it run through Babel so that it's baked into HTML?

Thank you!

@dmitrizzle
Copy link
Author

Should anyone else wonder, I built my own precompile.js that modifies HTML as-needed and added it in package.json's scripts object like so: "start": "node precompile && react-scripts start". Done the same for the build step as well. Seeing how this isn't related to CRA after all, I'm gonna close this. Thanks!

@lock lock bot locked and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant