question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Filechanges in /public in development?

See original GitHub issue

I have a css file in /public. If I change it while react-static start, the file is not being updated and the server still serves the old version. Essentially, I have to restart for every change in the css.

Is there a setting to change this? I could not find anything in the docs.

Thanks so much!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
EmilTholincommented, Nov 10, 2017

Hi @pA1nD!

The /public folder is indeed not watched, and is just copied to the /dist folder. If you instead import your CSS into one of your JavaScript files, it will be hot reloaded in development and extracted properly for production:

import React from 'react'
import { Router, Link } from 'react-static'
import Routes from 'react-static-routes'

import './app.css'

export default () => (
  <Router>
    <div>
      <nav>
        <Link to="/">Home</Link>
        <Link to="/about">About</Link>
        <Link to="/blog">Blog</Link>
      </nav>
      <div className="content">
        <Routes />
      </div>
    </div>
  </Router>
)
1reaction
totstepscommented, Nov 10, 2017

@EmilTholin It would be nice if we can show a warning if the user imports something(js or css) outside the src folder.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Force page reload in Development when external files have ...
I was wondering if there was a way to watch some local folders and force webpackHotDevClient to reload the page if a change...
Read more >
Access files in public directory after production (create-react ...
After deploying, I went back to make some changes and files in my 'public' directory were no longer showing in development (I used...
Read more >
Using the Public Folder - Create React App
Changing the HTML​. The public folder contains the HTML file so you can tweak it, for example, to set the page title. The...
Read more >
Reasonable Accommodations and Modifications - HUD
Reasonable accommodations may include changes which may be necessary in order for the person with a disability to use and enjoy a dwelling,...
Read more >
How to use files in public folder in ReactJS ? - GeeksforGeeks
html, javascript library files, images, and other assets, etc. which you don't want to be processed by webpack. Files in this folder are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found