Kenmore
Kenmore

Reputation: 1595

Developing Less CSS locally without a server; "no sheets were loaded"

So I'm trying to extract my own CSS framework from my projects so I can develop it separately.

I have my index.html with less.js and included my main .less file which @imports a dozen other files...

However, in the console I get an error for each of my less files:

Resource interpreted as Stylesheet but transferred with MIME type text/plain: "file:///path/to/project/src/file.less".

And a final line that says Less has finished and no sheets were loaded.

So I understand this to mean they aren't being served correctly, I normally use Node.js/Express, but I don't want to include all of that in my repo just to develop some CSS. How do I get around this?

I thought about using some node package like serve for development but I feel like this shouldn't be necessary.. Unless I'm wrong?

EDIT: here's my repo, https://github.com/kenmorechalfant/framewerk

Upvotes: 0

Views: 1162

Answers (1)

zero298
zero298

Reputation: 26877

Don't use file://. You're going to run into a mountain of XSS errors. Just use a quick static HTTP server. I use http-server with node and most IDEs have one built in. It is going to be more trouble that it's worth to try and not use a static HTTP server if you don't have a good reason not to.

Upvotes: 2

Related Questions