jekyll-plugin-frontend-build 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79ca4dce7ef732a091f7b1fe4735f18bb17231537891a2abafb59a9dbeb3ae94
4
- data.tar.gz: 9f65c010e904e66e0da1574d79e4761b647f783135ad49ef3af885912c7fd0c2
3
+ metadata.gz: 5987ae6cd0b6ec9a535820159b20aeb7c00fc81fcc048cacf3fdc331e3fdbe24
4
+ data.tar.gz: f18bef2460fc2be9649832969c329da34fe5d6c8d3489999f11d913236663ad9
5
5
  SHA512:
6
- metadata.gz: 3f14c463b98445488e8c63f29505a76dcfea69c4276105fd700cc7636bc154c941b00bacb231d15d58f28a7a5519703446033de26cd55e163c9b75025dbe339d
7
- data.tar.gz: 808d9ef0a609b27b0ea98350978231173c56a2a0ba5b155e96bda505ba87b36f8fefbeee0bddca889e868a26eb66e122c14c0407b71fc80554cd44276adf49b8
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 less worries about cross-browser compatibility.
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/[jekyll-site-skeleton] template.
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/[jekyll-site-skeleton]
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
+ ----
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'jekyll-plugin-frontend-build'
5
- s.version = '0.0.1'
5
+ s.version = '0.0.2'
6
6
  s.authors = ['Ribose Inc.']
7
7
  s.email = ['open.source@ribose.com']
8
8
 
@@ -1,7 +1,13 @@
1
1
  Jekyll::Hooks.register :site, :post_write do |site|
2
- run_frontend_build()
2
+ build_js()
3
3
  end
4
4
 
5
- def run_frontend_build()
6
- system('./node_modules/.bin/babel assets/js --out-dir _site/assets/js')
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.1
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-17 00:00:00.000000000 Z
11
+ date: 2019-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll