minipack 0.3.1 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ee2181b4e3046ef5d0bff95897d0f270f5693f611270d7a0a83fbe6b89b369af
4
- data.tar.gz: e8f7dd5422f6d05fb47524cae3bf7e6c30bbdf055be7bf047358379b18d761fb
3
+ metadata.gz: 8949f9e9776f0a6e534121def90526240429d8d12f3609459b48b8ed630182ff
4
+ data.tar.gz: e8ac86674922149eb2f98208ea514d579bfd7147afad838641d8eeeda7c190dd
5
5
  SHA512:
6
- metadata.gz: 0a83558f3ee2f90469e8d7eaa9d80e2c14c55813e5b2657601e092e3c1c1249c0aa8514f93335a5a4ee8963bfbf610fff17605b0dcf3d12170d03844c284beed
7
- data.tar.gz: da77a9a3b187fdc59d4ed0849349d4bb0758de7a859229993ce34e6cda3c8589bb9179e1d6ff75478371d09bb1e603f00eff7118b91e31af55bcf0d006ab91e2
6
+ metadata.gz: 10380141c2cfb30be94fb8e4daa3221696080f103526b4a54496fff0c87c53a8d2f47f2a93b306b169a08ba0bcecb3067b6c8debb84dc8a104bef38c32af0210
7
+ data.tar.gz: 7fd05ca76d124c9fc52ef3a2f79a16470b47444d17621ab0f20ddcbde08bd0231669c318336d6ec26fdd346989590e6e79fc006ef643813528af6d79e98da2dd
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.3.2 / 2019-07-22
2
+
3
+ ## Enhancements:
4
+
5
+ * Add ability to instruct minipack if CSS will be in the manifest (#22) by @jmortlock
6
+
1
7
  # 0.3.1 / 2019-06-06
2
8
 
3
9
  ## Bug fixes
data/README.md CHANGED
@@ -4,7 +4,7 @@ Minipack, a gem for minimalists, which can integrates Rails with [webpack](https
4
4
 
5
5
  Minipack provides view helpers through a manifest, which resolve paths of assets build by a webpack configured by you as you like.
6
6
 
7
- **Note:** Before Minipack v0.3.0, it was called WebpackManifest. Please refer to [the migration guide](./docs/migrate_from_webpack_manifest.md') from WebpackManifest.
7
+ **Note:** Before Minipack v0.3.0, it was called WebpackManifest. Please refer to [the migration guide](./docs/migrate_from_webpack_manifest.md) from WebpackManifest.
8
8
 
9
9
  ## Features
10
10
 
@@ -48,6 +48,9 @@ Minipack.configuration do |c|
48
48
  # Register a path to a manifest file here. Right now you have to specify an absolute path.
49
49
  c.manifest = Rails.root.join('public', 'assets', 'manifest.json')
50
50
 
51
+ # If you are not extracting CSS in your webpack config you should set this flag to false
52
+ # c.extract_css = !Rails.env.development?
53
+
51
54
  # The base directory for the frontend system. By default, it will be
52
55
  # `Rails.root`.
53
56
  # c.base_path = Rails.root
@@ -295,10 +298,6 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
295
298
 
296
299
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
297
300
 
298
- **v0.2.x-trunk**
299
-
300
- v0.2.x-trunk is made from the latest released version v0.2.4. I will not intend to actively maintain v0.2.x anymore, except security fixes or bug fixes.
301
-
302
301
  ## Contributing
303
302
 
304
303
  Bug reports and pull requests are welcome on GitHub at https://github.com/nikushi/minipack.
@@ -79,6 +79,9 @@ module Minipack
79
79
  # The command for installation of npm packages
80
80
  config_attr :pkg_install_command, default: 'npm install'
81
81
 
82
+ # Disable if you're webpack configuration is not extracting CSS files
83
+ config_attr :extract_css, default: true
84
+
82
85
  # Let me leave this line for remember the indea of post pkg install hooks
83
86
  # config_attr :post_install_hooks, default: []
84
87
 
@@ -164,6 +167,13 @@ module Minipack
164
167
  File.join(root_path, 'tmp', 'cache', 'minipack')
165
168
  end
166
169
 
170
+ # CSS is extracted in the webpack build
171
+ #
172
+ # @return [Boolean]
173
+ def extract_css?
174
+ extract_css
175
+ end
176
+
167
177
  private
168
178
 
169
179
  def root?
@@ -52,7 +52,9 @@ module Minipack::Helper
52
52
  # <link rel="stylesheet" media="screen"
53
53
  # href="/assets/web/pack/orders/style-1016838bab065ae1e122.css" />
54
54
  def stylesheet_bundle_tag(*names, manifest: nil, **options)
55
- stylesheet_link_tag(*sources_from_manifest(names, 'css', key: manifest), **options)
55
+ if Minipack.configuration.extract_css?
56
+ stylesheet_link_tag(*sources_from_manifest(names, 'css', key: manifest), **options)
57
+ end
56
58
  end
57
59
 
58
60
  # Creates link tags that references the css chunks from entrypoints when using split chunks API.
@@ -69,7 +71,9 @@ module Minipack::Helper
69
71
  # <%= stylesheet_bundles_with_chunks_tag 'calendar' %>
70
72
  # <%= stylesheet_bundles_with_chunks_tag 'map' %>
71
73
  def stylesheet_bundles_with_chunks_tag(*names, manifest: nil, **options)
72
- stylesheet_link_tag(*sources_from_manifest_entrypoints(names, 'css', key: manifest), **options)
74
+ if Minipack.configuration.extract_css?
75
+ stylesheet_link_tag(*sources_from_manifest_entrypoints(names, 'css', key: manifest), **options)
76
+ end
73
77
  end
74
78
 
75
79
  # Examples:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Minipack
4
- VERSION = "0.3.1"
4
+ VERSION = "0.3.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minipack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nobuhiro Nikushi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-06 00:00:00.000000000 Z
11
+ date: 2019-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview