Skip to content

Commit ee0c82f

Browse files
authored
Merge pull request #134 from windy/rails-bundling-css-js
Rails bundling css js
2 parents f0336ef + 32597c5 commit ee0c82f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+491
-7926
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,6 @@ yarn-debug.log*
5050
.env
5151
.byebug_history
5252
.DS_Store
53+
54+
/app/assets/builds/*
55+
!/app/assets/builds/.keep

Gemfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ ruby '3.1.2'
55
gem 'rails', '~> 6.1.4', '>= 6.1.4.1'
66
gem 'puma', '~> 4.x'
77
gem 'sass-rails', '>= 6'
8-
gem 'webpacker', '~> 5.0'
9-
gem 'turbo-rails', '~> 0.7'
8+
gem 'turbo-rails'
109
gem 'jbuilder', '~> 2.7'
1110
gem 'bootsnap', '>= 1.4.4', require: false
1211
gem 'stimulus-rails'
1312

13+
gem 'cssbundling-rails'
14+
gem 'jsbundling-rails'
15+
1416
gem 'rexml', '~> 3.2', '>= 3.2.4'
1517

1618
group :development, :test do
@@ -20,7 +22,7 @@ end
2022
group :development do
2123
gem 'web-console', '>= 4.1.0'
2224
gem 'rack-mini-profiler', '~> 2.0'
23-
gem 'listen', '~> 3.3'
25+
gem 'listen', '~> 3.9'
2426
gem 'spring'
2527
end
2628

Gemfile.lock

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ GEM
112112
concurrent-ruby (1.3.4)
113113
connection_pool (2.5.0)
114114
crass (1.0.6)
115+
cssbundling-rails (1.4.1)
116+
railties (>= 6.0.0)
115117
database_cleaner (2.1.0)
116118
database_cleaner-active_record (>= 2, < 3)
117119
database_cleaner-active_record (2.2.0)
@@ -142,6 +144,8 @@ GEM
142144
jbuilder (2.13.0)
143145
actionview (>= 5.0.0)
144146
activesupport (>= 5.0.0)
147+
jsbundling-rails (1.3.1)
148+
railties (>= 6.0.0)
145149
launchy (3.0.1)
146150
addressable (~> 2.8)
147151
childprocess (~> 5.0)
@@ -200,8 +204,6 @@ GEM
200204
rack-protection (3.2.0)
201205
base64 (>= 0.1.0)
202206
rack (~> 2.2, >= 2.2.4)
203-
rack-proxy (0.7.7)
204-
rack
205207
rack-test (2.2.0)
206208
rack (>= 1.3)
207209
rails (6.1.7.10)
@@ -282,7 +284,6 @@ GEM
282284
rexml (~> 3.2, >= 3.2.5)
283285
rubyzip (>= 1.2.2, < 3.0)
284286
websocket (~> 1.0)
285-
semantic_range (3.1.0)
286287
sidekiq (5.2.10)
287288
connection_pool (~> 2.2, >= 2.2.2)
288289
rack (~> 2.0)
@@ -314,7 +315,7 @@ GEM
314315
thor (1.3.2)
315316
tilt (2.5.0)
316317
timeout (0.4.3)
317-
turbo-rails (0.9.1)
318+
turbo-rails (2.0.11)
318319
actionpack (>= 6.0.0)
319320
railties (>= 6.0.0)
320321
tzinfo (2.0.6)
@@ -328,11 +329,6 @@ GEM
328329
nokogiri (~> 1.6)
329330
rubyzip (>= 1.3.0)
330331
selenium-webdriver (~> 4.0)
331-
webpacker (5.4.4)
332-
activesupport (>= 5.2)
333-
rack-proxy (>= 0.6.1)
334-
railties (>= 5.2)
335-
semantic_range (>= 2.3.0)
336332
websocket (1.2.11)
337333
websocket-driver (0.7.7)
338334
base64
@@ -354,15 +350,17 @@ DEPENDENCIES
354350
byebug
355351
capybara (>= 3.26)
356352
carrierwave
353+
cssbundling-rails
357354
database_cleaner
358355
factory_bot_rails
359356
figaro
360357
high_voltage (~> 3.1)
361358
html_truncator
362359
jbuilder (~> 2.7)
360+
jsbundling-rails
363361
kaminari!
364362
launchy
365-
listen (~> 3.3)
363+
listen (~> 3.9)
366364
mina (~> 1.2.2)
367365
mina-logs
368366
mina-multistage
@@ -390,11 +388,10 @@ DEPENDENCIES
390388
sprockets (~> 3.7.2)
391389
sprockets-rails (~> 3.2.1)
392390
stimulus-rails
393-
turbo-rails (~> 0.7)
391+
turbo-rails
394392
tzinfo-data
395393
web-console (>= 4.1.0)
396394
webdrivers
397-
webpacker (~> 5.0)
398395

399396
RUBY VERSION
400397
ruby 3.1.2p20

Procfile.dev

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
web: env RUBY_DEBUG_OPEN=true bin/rails server
2+
css: yarn build:css --watch --poll
3+
js: yarn build --watch

README.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ WBlog is open source blog which built for mobile first, it's licenced on MIT, us
1010

1111
New: WBlog is using Ruby on Rails 6.1 now.
1212

13+
New: WBlog has updated from webpacker to jsbundling & cssbundling with esbuild and sass.
14+
1315
[中文说明文档](/README.zh-CN.md)
1416

1517
Characteristic:
@@ -51,7 +53,7 @@ You can run it like a Ruby on Rails project as usual:
5153

5254
```shell
5355
ruby -v
54-
# 3.0.1
56+
# 3.1.2
5557
postgres --version
5658
# 9.x.x
5759
```
@@ -79,16 +81,8 @@ You can run it like a Ruby on Rails project as usual:
7981

8082
3. Start it
8183

82-
one terminal run:
83-
84-
```shell
85-
bin/webpack-dev-server
86-
```
87-
88-
another terminal run:
89-
9084
```shell
91-
rails s
85+
bin/dev
9286
```
9387

9488
Open browser with `http://localhost:3000`

app/assets/builds/.keep

Whitespace-only changes.

app/assets/config/manifest.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
//= link_tree ../images
2+
//= link_tree ../builds
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)