jekyll-webpack 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +2 -2
- data/lib/jekyll/webpack.rb +11 -3
- data/lib/jekyll/webpack/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8950c117cac046785121b78e1211c96c2f4ff14f1982cc5864c007600abe74c
|
4
|
+
data.tar.gz: 7d54401b026fe77b989e7c3f03930e4d356cfeef071cf61e7044fc7cd01cf5d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 663677f25c77ec5bdd8695eee148ebe5257fbc5f23bffd90bb3a4f9bd26e42c25d55adef1aab2a9c22711440ad786dc2b9624b676b5645d08a78237520cfd842
|
7
|
+
data.tar.gz: fa519caed15b050b873cae81b437d000d75423cbf980c9a10db8215cc5cd684e68dd09965dec92e5f9cd7f05d808b880c4365f35c01b4c41dc063d8edc7f908f
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -4,9 +4,9 @@ This plugin will allow you to build your assets with Webpack _after_ Jekyll has
|
|
4
4
|
|
5
5
|
## Why?
|
6
6
|
|
7
|
-
This adds Webpack at a sane point in the build pipeline and will also allow you to parameterize your webpack and other JS config files by prepending them with front matter, before the compilation occurs. You can see a functioning
|
7
|
+
This adds Webpack at a sane point in the build pipeline and will also allow you to parameterize your webpack and other JS config files by prepending them with front matter, before the compilation occurs. You can see a functioning example in the `spec/fixtures` folder:-
|
8
8
|
|
9
|
-
There is a `_data/tailwind.yml` file in the fixure site that's picked up by adding a frontmatter declaration in `tailwind.config.
|
9
|
+
There is a `_data/tailwind.yml` file in the fixure site that's picked up by adding a frontmatter declaration in `tailwind.config.js`. This Tailwind config is in turn picked up by the outputted webpack config and parsed when webpack runs.
|
10
10
|
|
11
11
|
|
12
12
|
## Installation
|
data/lib/jekyll/webpack.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require "jekyll/webpack/version"
|
4
4
|
require "jekyll"
|
5
|
+
require "open3"
|
5
6
|
|
6
7
|
module Jekyll
|
7
8
|
module Webpack
|
@@ -9,9 +10,16 @@ module Jekyll
|
|
9
10
|
|
10
11
|
def self.build(site)
|
11
12
|
site_dest = site.dest
|
12
|
-
|
13
|
-
|
14
|
-
|
13
|
+
|
14
|
+
stdout, stderr, status = Open3.capture3(
|
15
|
+
"../node_modules/.bin/webpack",
|
16
|
+
chdir: File.expand_path(site_dest)
|
17
|
+
)
|
18
|
+
|
19
|
+
runtime_error = stdout =~ /error/i
|
20
|
+
|
21
|
+
raise Error, stderr if stderr.size > 0
|
22
|
+
raise Error, stdout if !runtime_error.nil?
|
15
23
|
end
|
16
24
|
end
|
17
25
|
end
|