sprockets-commoner 0.2.8 → 0.3.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/CHANGELOG.md +4 -0
- data/README.md +2 -4
- data/lib/sprockets/commoner/bundle.rb +0 -1
- data/lib/sprockets/commoner/processor.rb +9 -0
- data/lib/sprockets/commoner/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1200dc7cccf599784642963b195556c816321e6b
|
4
|
+
data.tar.gz: 8e8171388710041409ac93b542f79fa302c9dc93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19c1680fabbf91d9847104149d656a31e160272d9ac902f5ff046079a17bfeda60ca99115d9790cd1874050660133fd8fa8caddb382d0b1f7ba1110060556b09
|
7
|
+
data.tar.gz: 273b85d3a6243d78cff1a7c35e51e9c72627577d533b45d13a8bd93d3daaff8004d5d2629b75d4fafc8af4ad9b2e39161a4fed46a41f3cd803c672c025e333b6
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -55,9 +55,7 @@ By default, commoner will process any file under the application root directory.
|
|
55
55
|
```ruby
|
56
56
|
# In config/initializers/sprockets_commoner.rb
|
57
57
|
Rails.application.config.assets.configure do |env|
|
58
|
-
|
59
|
-
env.register_postprocessor('application/javascript', Sprockets::Commoner::Processor.new(
|
60
|
-
env.root,
|
58
|
+
Sprockets::Commoner::Processor.configure(env,
|
61
59
|
# include, exclude, and babel_exclude patterns can be path prefixes or regexes.
|
62
60
|
# Explicitely list paths to include. The default is `[env.root]`
|
63
61
|
include: ['app/assets/javascripts/subdirectory'],
|
@@ -66,7 +64,7 @@ Rails.application.config.assets.configure do |env|
|
|
66
64
|
# Anything listed in babel_exclude has its require calls resolved, but no transforms listed in .babelrcs applied.
|
67
65
|
# Default is [/node_modules/]
|
68
66
|
babel_exclude: [/node_modules/]
|
69
|
-
)
|
67
|
+
)
|
70
68
|
end
|
71
69
|
```
|
72
70
|
|
@@ -47,6 +47,15 @@ module Sprockets
|
|
47
47
|
instance(input[:environment]).call(input)
|
48
48
|
end
|
49
49
|
|
50
|
+
def self.configure(env, *args, **kwargs)
|
51
|
+
env.postprocessors['application/javascript'].each do |processor|
|
52
|
+
if processor == self || processor.is_a?(self)
|
53
|
+
env.unregister_postprocessor('application/javascript', processor)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
env.register_postprocessor('application/javascript', self.new(env.root, *args, **kwargs))
|
57
|
+
end
|
58
|
+
|
50
59
|
attr_reader :include, :exclude, :babel_exclude
|
51
60
|
def initialize(root, include: [root], exclude: ['vendor/bundle'], babel_exclude: [/node_modules/])
|
52
61
|
@root = root
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sprockets-commoner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bouke van der Bijl
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sprockets
|
@@ -184,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
184
|
version: '0'
|
185
185
|
requirements: []
|
186
186
|
rubyforge_project:
|
187
|
-
rubygems_version: 2.5.1
|
187
|
+
rubygems_version: 2.4.5.1
|
188
188
|
signing_key:
|
189
189
|
specification_version: 4
|
190
190
|
summary: Use Babel in Sprockets to compile modules for the browser
|