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

./static folder with hot code reload? #709

Closed
thebetterjort opened this issue Jan 9, 2017 · 6 comments
Closed

./static folder with hot code reload? #709

thebetterjort opened this issue Jan 9, 2017 · 6 comments

Comments

@thebetterjort
Copy link

I have video files that I serve out of the /static/ folder. As a user streams a video it gets added automatically to static. The issue is that the page doesn't refresh when a new video is added, forcing the user to hit refresh to get the new data.

Is there a fix that I can use to make the static folder force a render? Maybe I use componentDidMount() and just query the directory? Any thoughts on the best way to do this would be appreciated.

@arunoda
Copy link
Contributor

arunoda commented Jan 9, 2017

We do hot-reload only un the dev mode only.
So, your original goal might not work here.

To clarify my above point, are you looking this as a production behaviour or only in dev mode?

@thebetterjort
Copy link
Author

thebetterjort commented Jan 10, 2017

Looking for production. I think I'm going to rethink my approach. If I wanted to run some server side scripts could this be done or should I move to Meteor where I have a little bit more control over the server side aspect? Where can I run server side code before the app loads?

@impronunciable
Copy link
Contributor

@thebetterjort you can integrate next with the node.js ecosystem https://github.com/zeit/next.js#custom-server-and-routing or run another separate server. HMR is for code and your videos are more like your data rather than your code.

Since it seems to be a nofix I'm closing this issue but feel free to reopen

@three-fourteen
Copy link

three-fourteen commented May 26, 2017

@arunoda & @impronunciable Sorry to bother with this closed issues, but I have a question related to this. I have a global CSS compiled to the 'static' folder doing this:

"scripts": {
    "build": "next build",
    "prestart": "next build",
    "start": "node server.js",
    "dev": "parallelshell \"node server.js\" \"yarn watch:css\"",
    "css": "node-sass --include-path css --output-style compressed styles/styles.scss static/css/bundle.css",
    "watch:css": "yarn css"
  }

What I'm looking for is to have hot reload when the CSS file is compiled. Is there a way to do it?

Thanks in advance.

@luisrudge
Copy link

I want to do the same thing as @andres314. Is it possible, @arunoda?

@programbo
Copy link
Contributor

programbo commented Sep 4, 2017

Turns out I need to do the same thing until the next major version of Grommet (with css-in-js) is released. I prematurely thought I would never need to touch SCSS again.

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018
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

6 participants