jekyll-plugin-frontend-build 0.0.1 → 0.0.2
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/README.adoc +30 -4
- data/jekyll-plugin-frontend-build.gemspec +1 -1
- data/lib/jekyll-plugin-frontend-build/run_babel.rb +9 -3
- 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: 5987ae6cd0b6ec9a535820159b20aeb7c00fc81fcc048cacf3fdc331e3fdbe24
|
4
|
+
data.tar.gz: f18bef2460fc2be9649832969c329da34fe5d6c8d3489999f11d913236663ad9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26d8a757eb7bf218de513f964bfe9b8a3f5f04f53dd10aecedc9be3fe5b285faef8e91e1341499accd2456e9ded60fd745ab1d826df69adb64072cb1e921771b
|
7
|
+
data.tar.gz: fbbc614a8650db76b6966d0165f12ba891c46f6f5b4159ff1bc1b46437dbb4676a93b55c80caac694e8d3864f0f238a94eb5232a665686ae5b52892227cacfd2
|
data/README.adoc
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
= Jekyll frontend build plugin
|
2
2
|
|
3
|
-
This is a very plugin that post-processes frontend assets,
|
3
|
+
This is a very minimal plugin that post-processes frontend assets,
|
4
4
|
enabling you to use the latest ES features
|
5
|
-
with
|
5
|
+
with fewer worries about cross-browser compatibility.
|
6
6
|
|
7
7
|
This plugin depends on Node/NPM and currently uses Babel.
|
8
8
|
|
@@ -12,8 +12,12 @@ and `_site/assets` as output.
|
|
12
12
|
Current limitations:
|
13
13
|
|
14
14
|
* As of now, it only processes JavaScript files under `assets/js` with Babel.
|
15
|
+
|
16
|
+
Caveats:
|
17
|
+
|
15
18
|
* The output & source directories are hard-coded;
|
16
19
|
if your site output directory is not `_site` this won’t work.
|
20
|
+
* You may need to include Babel’s polyfill script explicitly.
|
17
21
|
|
18
22
|
Roadmap:
|
19
23
|
|
@@ -30,7 +34,7 @@ This plugin requires Node & NPM to be available in Jekyll build environment.
|
|
30
34
|
== Setting up
|
31
35
|
|
32
36
|
A quick way to use this plugin with a new site is to use
|
33
|
-
the https://github.com/riboseinc/
|
37
|
+
the https://github.com/riboseinc/jekyll-site-skeleton[Jekyll site] template.
|
34
38
|
|
35
39
|
Alternatively, to add this plugin to an existing site,
|
36
40
|
create the following files in your site root,
|
@@ -81,5 +85,27 @@ The plugin will take effect if you run `jekyll serve` as usual.
|
|
81
85
|
Just make sure that Node/NPM are available in your environment,
|
82
86
|
and call `npm install` before building the site.
|
83
87
|
|
84
|
-
See `.travis.yml` in https://github.com/riboseinc/
|
88
|
+
See `.travis.yml` in https://github.com/riboseinc/jekyll-site-skeleton
|
85
89
|
for an example.
|
90
|
+
|
91
|
+
== Troubleshooting
|
92
|
+
|
93
|
+
=== `ReferenceError: regeneratorRuntime is not defined`
|
94
|
+
|
95
|
+
You may need to include Babel polyfills before your code. Example ways of doing this:
|
96
|
+
|
97
|
+
* If you’re getting this error in normal browser window context
|
98
|
+
|
99
|
+
[source,html]
|
100
|
+
----
|
101
|
+
<script src="/assets/js/babel-polyfill.js"></script>
|
102
|
+
----
|
103
|
+
|
104
|
+
* If you’re getting this error in Web worker context
|
105
|
+
|
106
|
+
[source,javascript]
|
107
|
+
----
|
108
|
+
importScripts('/assets/js/babel-polyfill.js');
|
109
|
+
|
110
|
+
// The rest of the code
|
111
|
+
----
|
@@ -1,7 +1,13 @@
|
|
1
1
|
Jekyll::Hooks.register :site, :post_write do |site|
|
2
|
-
|
2
|
+
build_js()
|
3
3
|
end
|
4
4
|
|
5
|
-
def
|
6
|
-
|
5
|
+
def build_js()
|
6
|
+
|
7
|
+
# Copy Babel polyfills
|
8
|
+
system('cp node_modules/@babel/polyfill/dist/polyfill.min.js _site/assets/js/babel-polyfill.js')
|
9
|
+
|
10
|
+
# Transpile JS assets
|
11
|
+
system('./node_modules/.bin/babel _site/assets/js --out-dir _site/assets/js')
|
12
|
+
|
7
13
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-plugin-frontend-build
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|