jekyll-postcss 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +13 -0
- data/bin/postcss +2 -2
- data/lib/jekyll/converters/postcss.rb +8 -2
- data/lib/jekyll-postcss/version.rb +1 -1
- data/package.json +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4610bf3b4f73b8c871bdc5ae6f91ff3f461128b5ce34716486bbcbb77987a1d
|
4
|
+
data.tar.gz: d1033851975011342f10ad19c6acfd1b9168aa736cc0071766cb17eeefcd6fe5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c9a64927c2b52f7041624b9413745b4f0e4539c2066c85533723d543c580bc946cf7e21426a02b29af2ca048eb821e896398433d0e575b560426099b787ac5f
|
7
|
+
data.tar.gz: 31b02f8c9c9b8610daff01bb5bd58622ff7354ea9f688c8d25018678996efdb3a9737dbe4ff67bc011090a7edcca938061a2c1b811319d7a8e0a6a0731f31119
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.5.0
|
4
|
+
|
5
|
+
- Option to disable the cache #32 by [Tristan Dunn](https://github.com/tristandunn)
|
6
|
+
- Show full PostCSS error and stack trace #31 by [Carl Furrow](https://github.com/cfurrow)
|
7
|
+
|
3
8
|
## 0.4.1
|
4
9
|
|
5
10
|
- Fix a weird issue where the jekyll server never booted up because the converter class got in an infinite loop trying to make a socket connection to the postcss server.
|
data/README.md
CHANGED
@@ -57,6 +57,19 @@ module.exports = {
|
|
57
57
|
};
|
58
58
|
```
|
59
59
|
|
60
|
+
### Caching
|
61
|
+
|
62
|
+
Caching is enabled by default so PostCSS will only be called when the CSS content has changed. If needed you can disable caching in your Jekyll configuration to force the CSS to be recompiled every time.
|
63
|
+
|
64
|
+
If you are using the [TailwindCSS JIT](https://tailwindcss.com/docs/just-in-time-mode), you most likely need to disable the caching feature.
|
65
|
+
|
66
|
+
```yaml
|
67
|
+
# _config.yml
|
68
|
+
|
69
|
+
postcss:
|
70
|
+
cache: false
|
71
|
+
```
|
72
|
+
|
60
73
|
### Deployment
|
61
74
|
|
62
75
|
When deploying, make sure to set your `JEKYLL_ENV` to something like `production` or `staging`. This is necessary to make sure that jekyll-postcss will not use internal development conveniences when building on your host's servers.
|
data/bin/postcss
CHANGED
@@ -7,11 +7,11 @@ const net = require("net");
|
|
7
7
|
class PostCSS {
|
8
8
|
static process(data, write) {
|
9
9
|
postcss(config.plugins)
|
10
|
-
.process(JSON.parse(data).raw_content, { from:
|
10
|
+
.process(JSON.parse(data).raw_content, { from: undefined })
|
11
11
|
.then((result) => write(result))
|
12
12
|
.catch((error) => {
|
13
13
|
console.error("PostCSS Error!\n");
|
14
|
-
console.error(error
|
14
|
+
console.error(error);
|
15
15
|
});
|
16
16
|
}
|
17
17
|
|
@@ -12,6 +12,7 @@ module Jekyll
|
|
12
12
|
def initialize(config = {})
|
13
13
|
super
|
14
14
|
|
15
|
+
@cache_enabled = config.fetch("postcss", {}).fetch("cache", true)
|
15
16
|
@socket = config.fetch("socket") { ::PostCss::Socket.new }
|
16
17
|
@raw_cache = nil
|
17
18
|
@import_raw_cache = {}
|
@@ -32,7 +33,7 @@ module Jekyll
|
|
32
33
|
@raw_digest = Digest::MD5.hexdigest content
|
33
34
|
@raw_import_digests = import_digests(content)
|
34
35
|
|
35
|
-
if cache_miss
|
36
|
+
if cache_disabled? || cache_miss?
|
36
37
|
@raw_cache = @raw_digest.dup
|
37
38
|
@import_raw_cache = @raw_import_digests.dup
|
38
39
|
|
@@ -58,10 +59,15 @@ module Jekyll
|
|
58
59
|
end
|
59
60
|
end
|
60
61
|
|
61
|
-
def
|
62
|
+
def cache_disabled?
|
63
|
+
@cache_enabled == false
|
64
|
+
end
|
65
|
+
|
66
|
+
def cache_miss?
|
62
67
|
@raw_import_digests
|
63
68
|
.map { |import, hash| @import_raw_cache[import] != hash }
|
64
69
|
.unshift(@raw_cache != @raw_digest)
|
70
|
+
.any?
|
65
71
|
end
|
66
72
|
|
67
73
|
def reset
|
data/package.json
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-postcss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mitchell Hanberg
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|