webpacker_lite 0.0.5 → 1.0.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 +13 -0
- data/README.md +21 -1
- data/lib/tasks/webpacker.rake +2 -3
- data/lib/tasks/webpacker_lite/clobber.rake +17 -0
- data/lib/webpacker_lite/manifest.rb +1 -1
- data/lib/webpacker_lite/railtie.rb +4 -0
- data/lib/webpacker_lite/version.rb +1 -1
- metadata +4 -6
- data/lib/install/config/webpack/development.server.yml +0 -16
- data/lib/install/config/webpack/paths.yml +0 -31
- data/lib/install/template.rb +0 -10
- data/lib/tasks/webpacker_lite/install.rake +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8639e91747db6f8fdcc978cb2ec8e454d0a01b7
|
4
|
+
data.tar.gz: 1b4a93698db3a570369886138c1adb58673c2f58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73409d286c0497e8086904233a8cf6301438983f890664c44c452f8114611c592ba64959e2e188ba332f17beedc28af62698e7d7ff98e8a844e98b660e805638
|
7
|
+
data.tar.gz: d8744e4cb8ea2626877f54e4cb49869a5185186af1a4d1f3e11717285dd17d3d7c244d9fe8dd19249e5d17f97e7915440ae0b96b38ca459a1b3d4f98212f3e5d
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Change Log
|
2
|
+
All notable changes to this project's source code will be documented in this file. Items under `Unreleased` is upcoming features that will be out in next version. NOTE: major versions of the npm module and the gem must be kept in sync.
|
3
|
+
|
4
|
+
Contributors: please follow the recommendations outlined at [keepachangelog.com](http://keepachangelog.com/). Please use the existing headings and styling as a guide, and add a link for the version diff at the bottom of the file. Also, please update the `Unreleased` link to compare to the latest release version.
|
5
|
+
|
6
|
+
## [Unreleased]
|
7
|
+
*Please add entries here for your pull requests.*
|
8
|
+
|
9
|
+
## [1.0.0] - 2017-05-03
|
10
|
+
Initial release
|
11
|
+
|
12
|
+
[Unreleased]: https://github.com/shakacode/webpacker_lite/compare/1.0.0...master
|
13
|
+
[1.0.0]: https://github.com/shakacode/react_on_rails/compare/0.0.5...1.0.0
|
data/README.md
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
[](https://github.com/shakacode/webpacker_lite)
|
3
3
|
|
4
4
|
Webpacker Lite provides the webpack enabled asset helpers from [Webpacker](https://github.com/rails/webpacker).
|
5
|
-
[React on Rails](https://github.com/shakacode/react_on_rails) will soon support using Webpacker Lite
|
5
|
+
[React on Rails](https://github.com/shakacode/react_on_rails) will soon support using Webpacker Lite,
|
6
|
+
including other optimizations for [React on Rails](https://github.com/shakacode/react_on_rails)
|
6
7
|
|
7
8
|
# NEWS
|
8
9
|
* 2017-04-09: React on Rails 7.0.0 beta work to include webpacker_lite gem has begun. See [#786](https://github.com/shakacode/react_on_rails/issues/786
|
@@ -17,6 +18,8 @@ Webpacker Lite provides the webpack enabled asset helpers from [Webpacker](https
|
|
17
18
|
WebpackerLite is currently compatible with Rails 4.2+, but there's no guarantee it will still be
|
18
19
|
in the future.
|
19
20
|
|
21
|
+
The best way to see the installation of webpacker_lite is to use the generator for React on Rails 7.1.0 or greater.
|
22
|
+
|
20
23
|
## Overview
|
21
24
|
|
22
25
|
1. Configure the location of your Webpack output in the `config/webpack/paths.yml` file.
|
@@ -31,6 +34,23 @@ in the future.
|
|
31
34
|
<%= stylesheet_pack_tag 'main' %>
|
32
35
|
```
|
33
36
|
|
37
|
+
## Rake Tasks
|
38
|
+
|
39
|
+
### Examples
|
40
|
+
|
41
|
+
To see available webpacker_lite rake tasks:
|
42
|
+
|
43
|
+
```
|
44
|
+
rake webpacker_lite
|
45
|
+
```
|
46
|
+
|
47
|
+
If you are using different directories for the output paths per RAILS_ENV, this is how you'd delete the files created for tests:
|
48
|
+
```
|
49
|
+
RAILS_ENV=test rake webpacker_lite:clobber
|
50
|
+
```
|
51
|
+
|
52
|
+
|
53
|
+
|
34
54
|
## Hot Reloading Config
|
35
55
|
Similary, you can also control and configure `webpack-dev-server` settings from
|
36
56
|
`config/webpack/development.server.yml` file
|
data/lib/tasks/webpacker.rake
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
tasks = {
|
2
|
-
"webpacker_lite:
|
3
|
-
"webpacker_lite:compile" => "Compiles webpack bundles based on environment",
|
2
|
+
"webpacker_lite:clobber" => "Remove the webpack compiled output directory as defined in config/webpack/paths.yml",
|
4
3
|
"webpacker_lite:check_node" => "Verifies if Node.js is installed",
|
5
4
|
"webpacker_lite:check_yarn" => "Verifies if yarn is installed",
|
6
|
-
"webpacker_lite:verify_install" => "Verifies if webpacker is installed"
|
5
|
+
"webpacker_lite:verify_install" => "Verifies if webpacker is installed"
|
7
6
|
}.freeze
|
8
7
|
|
9
8
|
desc "Lists all available tasks in webpacker_lite"
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require "webpacker_lite/configuration"
|
2
|
+
|
3
|
+
namespace :webpacker_lite do
|
4
|
+
desc "Remove the webpack compiled output directory as defined in config/webpack/paths.yml"
|
5
|
+
task clobber: ["webpacker_lite:verify_install", :environment] do
|
6
|
+
output_path = WebpackerLite::Configuration.output_path
|
7
|
+
FileUtils.rm_r(output_path) if File.exist?(output_path)
|
8
|
+
puts "Removed webpack output path directory #{output_path}"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# Run clobber if the assets:clobber is run
|
13
|
+
if Rake::Task.task_defined?("assets:clobber")
|
14
|
+
Rake::Task["assets:clobber"].enhance do
|
15
|
+
Rake::Task["webpacker:clobber"].invoke
|
16
|
+
end
|
17
|
+
end
|
@@ -16,7 +16,7 @@ class WebpackerLite::Manifest < WebpackerLite::FileLoader
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def lookup(name)
|
19
|
-
load if WebpackerLite::Env.development?
|
19
|
+
load if WebpackerLite::Env.development? || instance.data.empty?
|
20
20
|
raise WebpackerLite::FileLoader::FileLoaderError.new("WebpackerLite::Manifest.load must be called first") unless instance
|
21
21
|
instance.data[name.to_s] || raise(WebpackerLite::FileLoader::NotFoundError.new("Can't find #{name} in #{file_path}. Is webpack still compiling?"))
|
22
22
|
end
|
@@ -8,6 +8,10 @@ class WebpackerLite::Engine < ::Rails::Engine
|
|
8
8
|
ActionController::Base.helper WebpackerLite::Helper
|
9
9
|
end
|
10
10
|
|
11
|
+
ActiveSupport.on_load :action_view do
|
12
|
+
include WebpackerLite::Helper
|
13
|
+
end
|
14
|
+
|
11
15
|
WebpackerLite.bootstrap
|
12
16
|
Spring.after_fork { WebpackerLite.bootstrap } if defined?(Spring)
|
13
17
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webpacker_lite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson, Justin Gordon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -75,18 +75,16 @@ files:
|
|
75
75
|
- ".gitignore"
|
76
76
|
- ".rubocop.yml"
|
77
77
|
- ".travis.yml"
|
78
|
+
- CHANGELOG.md
|
78
79
|
- Gemfile
|
79
80
|
- Gemfile.lock
|
80
81
|
- MIT-LICENSE
|
81
82
|
- README.md
|
82
83
|
- Rakefile
|
83
|
-
- lib/install/config/webpack/development.server.yml
|
84
|
-
- lib/install/config/webpack/paths.yml
|
85
|
-
- lib/install/template.rb
|
86
84
|
- lib/tasks/webpacker.rake
|
87
85
|
- lib/tasks/webpacker_lite/check_node.rake
|
88
86
|
- lib/tasks/webpacker_lite/check_yarn.rake
|
89
|
-
- lib/tasks/webpacker_lite/
|
87
|
+
- lib/tasks/webpacker_lite/clobber.rake
|
90
88
|
- lib/tasks/webpacker_lite/verify_install.rake
|
91
89
|
- lib/webpacker_lite.rb
|
92
90
|
- lib/webpacker_lite/configuration.rb
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# Restart webpack-dev-server if you make changes here
|
2
|
-
default: &default
|
3
|
-
enabled: true
|
4
|
-
host: localhost
|
5
|
-
port: 8080
|
6
|
-
|
7
|
-
development:
|
8
|
-
<<: *default
|
9
|
-
|
10
|
-
test:
|
11
|
-
<<: *default
|
12
|
-
enabled: false
|
13
|
-
|
14
|
-
production:
|
15
|
-
<<: *default
|
16
|
-
enabled: false
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# Restart webpack-watcher or webpack-dev-server if you make changes here
|
2
|
-
default: &default
|
3
|
-
config: config/webpack
|
4
|
-
entry: packs
|
5
|
-
output: public
|
6
|
-
manifest: manifest.json
|
7
|
-
node_modules: node_modules
|
8
|
-
source: app/javascript
|
9
|
-
extensions:
|
10
|
-
- .coffee
|
11
|
-
- .js
|
12
|
-
- .jsx
|
13
|
-
- .ts
|
14
|
-
- .vue
|
15
|
-
- .sass
|
16
|
-
- .scss
|
17
|
-
- .css
|
18
|
-
- .png
|
19
|
-
- .svg
|
20
|
-
- .gif
|
21
|
-
- .jpeg
|
22
|
-
|
23
|
-
development:
|
24
|
-
<<: *default
|
25
|
-
|
26
|
-
test:
|
27
|
-
<<: *default
|
28
|
-
manifest: manifest-test.json
|
29
|
-
|
30
|
-
production:
|
31
|
-
<<: *default
|
data/lib/install/template.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
WEBPACKER_APP_TEMPLATE_PATH = File.expand_path("../../install/template.rb", __dir__)
|
2
|
-
|
3
|
-
namespace :webpacker_lite do
|
4
|
-
desc "Install webpacker lite in this application"
|
5
|
-
task install: [:check_node, :check_yarn] do
|
6
|
-
if Rails::VERSION::MAJOR >= 5
|
7
|
-
exec "./bin/rails app:template LOCATION=#{WEBPACKER_APP_TEMPLATE_PATH}"
|
8
|
-
else
|
9
|
-
exec "./bin/rake rails:template LOCATION=#{WEBPACKER_APP_TEMPLATE_PATH}"
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|