Comments (2)
@megavolkan you're correct that should be hot reloading when a change is made; however, that's not what is happening.
You can see that inside of src/dev.js
https://github.com/thedevdojo/static/blob/main/src/dev.js#L32
We are specifying the extensions we want to watch for:
const liveReloadOptions = {
port: liveReloadAvailablePort,
exts: ['html', 'css', 'js', 'png', 'gif', 'jpg', 'md']
};
In the next lines we create the LiveReload server and loop through a few folders to watch for:
const liveReloadServer = livereload.createServer(liveReloadOptions);
for(let i = 0; i < staticFoldersToWatch.length; i++){
liveReloadServer.watch(currentDirectory + "/" + staticFoldersToWatch[i] + "/**/*");
}
The assets folder is inside of the staticFoldersToWatch
array at the top of the file:
const staticFoldersToWatch = ['assets', 'collections', 'content', 'includes', 'layouts', 'pages', 'public'];
So, you are correct that it is not working as intended.
The weird thing is that I can add a file at /assets/css/test.html
and when I make updates to that file it livereloads. So for some reason it's not respecting the exts
list.
I've double checked that this is the recommended way to use this library. Here is the livereload library that Static is using:
https://www.npmjs.com/package/livereload
https://github.com/napcs/node-livereload
I've spent about an hour trying to debug with no luck, so I'll have to give it another try soon and dig a little deeper.
Feel free to try and debug if you have some extra time. To do so you can git clone this repo onto your machine and run npm install
https://github.com/thedevdojo/static.git
cd static
npm install
Then, you can run:
npm link
This command will link the code from that folder to the static
command. When you want to unlink you can run:
npm unlink
No worries if you can't debug. I'll be sure to give it another debugging try over the weekend 🤜🤛
Talk to you soon.
from static.
Hi, is there any progress? I have tried a few thing, yet they did not work either. Removed tailwind altogether (not a huge fan o it). Added additional .css files to the /assets folder and run 'static build' but additional css files are not compiled into the _site folder, only main.css. I suppose build process is not watching /assets/css folder other than main.css file. On the other hand /assets/js folder is watched and compiled without a problem. I really do want to use Static, for its simplicity, file based routing and other bells and whistles but I think it has a long way ahead.
from static.
Related Issues (14)
- Congrats + a first question :) HOT 3
- Wrong install command for templates in templates GitHub repo HOT 1
- New Website Initialization Fails, Missing package.json HOT 10
- Page transitions guide? HOT 1
- Reverse ordering of collections HOT 1
- SASS support HOT 1
- build command for subfolder not working... (github pages subfolder) HOT 2
- Tailwind @apply is not working on 'static dev' but works in built
- issues with self closing tag, space between start and end dag, and using {slot} inside component HOT 1
- the version of Node HOT 1
- Can not install
- Failed to create project due to null value of "global-modules-path"
- markdown not working? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from static.