jekyll-browserify 0.2.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -7
- data/jekyll-browserify.gemspec +1 -1
- data/lib/jekyll/browserify/version.rb +1 -1
- data/lib/jekyll/converters/browserify.rb +27 -12
- data/package.json +9 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90badef3c624cf26da7b1b9581538657ebf60564
|
4
|
+
data.tar.gz: bb525bdd295d1f500b17ef7a97e47c63f5c2410d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0219b23ed2d72631d5aa84b0512c2b528c25eaae9276dfa3785d6b9f530172b770a23621b1bdb0b02843aa13fc371165f5f66defe51d54c5a6685eeedcee084
|
7
|
+
data.tar.gz: dc925995978b5b3f9a0bd2bc0cdcf5e48a522cc812db56df953ce77d907a5afc7d92be538f4243c1f12081fea20f7574db9848a95286995ec319645c53a86771
|
data/README.md
CHANGED
@@ -31,17 +31,16 @@ $ cat main.js
|
|
31
31
|
console.log("foo");
|
32
32
|
$ jekyll build
|
33
33
|
$ cat _site/main.js
|
34
|
-
# conterted code
|
34
|
+
# ... conterted code ...
|
35
35
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
36
36
|
|
37
37
|
Add the below to `_config.yaml` if you want to use with [babel][]:
|
38
38
|
|
39
39
|
~~~~~~~~~~~~~~~~~~~~~~~~~~_config.yaml
|
40
|
+
# require `npm install -D browserify baberify babel-preset-es2015`
|
41
|
+
|
40
42
|
browserify:
|
41
|
-
|
42
|
-
- babelify
|
43
|
-
- babel-preset-es2015
|
44
|
-
option: "-t [ babelify --presets es2015 ]"
|
43
|
+
command: "$(npm bin)/browserify -t [ babelify --presets es2015 ]"
|
45
44
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
46
45
|
|
47
46
|
### Confing items and Default Values
|
@@ -49,9 +48,22 @@ browserify:
|
|
49
48
|
~~~~~~~~~~~~~~~~~~~~~~~~~yaml
|
50
49
|
# _config.yaml
|
51
50
|
browserify:
|
52
|
-
modules: [] # required modules
|
53
|
-
option: "" # browserify option string
|
54
51
|
exts: [".js"] # target exts to convert
|
52
|
+
|
53
|
+
# set nvm properties if you want to use with nvm installed automatically
|
54
|
+
nvm:
|
55
|
+
|
56
|
+
# required modules
|
57
|
+
modules: []
|
58
|
+
|
59
|
+
# browserify option string
|
60
|
+
option: ""
|
61
|
+
|
62
|
+
# node version if you specify, or use '.nvmrc' if 'null'
|
63
|
+
node_version: null
|
64
|
+
|
65
|
+
# use installed 'browserify'
|
66
|
+
command: "browserify -"
|
55
67
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
56
68
|
|
57
69
|
[babel]: https://github.com/babel/babelify
|
data/jekyll-browserify.gemspec
CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
27
|
spec.require_paths = ["lib"]
|
28
28
|
|
29
|
-
spec.add_runtime_dependency "browserify_rb", "~> 0.
|
29
|
+
spec.add_runtime_dependency "browserify_rb", "~> 1.0.0"
|
30
30
|
|
31
31
|
spec.add_development_dependency "jekyll", ENV['JEKYLL_VERSION'] ? "~> #{ENV['JEKYLL_VERSION']}" : ">= 2.0"
|
32
32
|
spec.add_development_dependency "bundler", "~> 1.10"
|
@@ -7,6 +7,7 @@ module Jekyll
|
|
7
7
|
def initialize config
|
8
8
|
super
|
9
9
|
@browserify = nil
|
10
|
+
system "npm install"
|
10
11
|
end
|
11
12
|
|
12
13
|
def matches ext
|
@@ -24,28 +25,42 @@ module Jekyll
|
|
24
25
|
|
25
26
|
def setup
|
26
27
|
require "browserify_rb"
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
28
|
+
if use_nvm?
|
29
|
+
@browserify = BrowserifyRb::Nvm::Browserify.new(
|
30
|
+
required_modules: nvm_modules,
|
31
|
+
browserify_opts: nvm_option,
|
32
|
+
nvm_dir: File.join(ENV["PWD"], ".nvm"),
|
33
|
+
node_ver: nvm_node_ver
|
34
|
+
)
|
35
|
+
else
|
36
|
+
@browserify = BrowserifyRb::Browserify.new(
|
37
|
+
command: command
|
38
|
+
)
|
39
|
+
end
|
33
40
|
end
|
34
41
|
|
35
42
|
def exts
|
36
43
|
(config("browserify", "exts") || [".js"]).map(&:downcase)
|
37
44
|
end
|
38
45
|
|
39
|
-
def
|
40
|
-
config("browserify", "
|
46
|
+
def command
|
47
|
+
config("browserify", "command") || "browserify -"
|
41
48
|
end
|
42
49
|
|
43
|
-
def
|
44
|
-
config("browserify", "
|
50
|
+
def nvm_modules
|
51
|
+
config("browserify", "nvm", "modules") || []
|
45
52
|
end
|
46
53
|
|
47
|
-
def
|
48
|
-
config("browserify", "
|
54
|
+
def nvm_option
|
55
|
+
config("browserify", "nvm", "option") || ""
|
56
|
+
end
|
57
|
+
|
58
|
+
def nvm_node_ver
|
59
|
+
config("browserify", "nvm", "node_version")
|
60
|
+
end
|
61
|
+
|
62
|
+
def use_nvm?
|
63
|
+
not config("browserify", "nvm").nil?
|
49
64
|
end
|
50
65
|
|
51
66
|
def config *path
|
data/package.json
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-browserify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Keiichiro Ui
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 1.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 1.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: jekyll
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -99,6 +99,7 @@ files:
|
|
99
99
|
- lib/jekyll/browserify.rb
|
100
100
|
- lib/jekyll/browserify/version.rb
|
101
101
|
- lib/jekyll/converters/browserify.rb
|
102
|
+
- package.json
|
102
103
|
homepage: https://github.com/kui/jekyll-browserify
|
103
104
|
licenses:
|
104
105
|
- MIT
|