File tree Expand file tree Collapse file tree 16 files changed +299
-396
lines changed Expand file tree Collapse file tree 16 files changed +299
-396
lines changed Original file line number Diff line number Diff line change 1
- ruby- 2.7.1
1
+ 2.7.5
Original file line number Diff line number Diff line change 3
3
source "https://rubygems.org"
4
4
git_source ( :github ) { |repo | "https://github.com/#{ repo } .git" }
5
5
6
- ruby "2.7.3 "
6
+ ruby "2.7.5 "
7
7
8
8
gem "react_on_rails" , "12.5.2"
9
- gem "webpacker " , "6.0.0.rc.6 "
9
+ gem "shakapacker " , "6.0.2 "
10
10
11
11
# Bundle edge Rails instead: gem "rails", github: "rails/rails"
12
12
gem "listen"
Original file line number Diff line number Diff line change 299
299
rubyzip (>= 1.2.2 )
300
300
semantic_range (3.0.0 )
301
301
sexp_processor (4.16.0 )
302
+ shakapacker (6.0.2 )
303
+ activesupport (>= 5.2 )
304
+ rack-proxy (>= 0.6.1 )
305
+ railties (>= 5.2 )
306
+ semantic_range (>= 2.3.0 )
302
307
simplecov (0.16.1 )
303
308
docile (~> 1.1 )
304
309
json (>= 1.8 , < 3 )
@@ -392,15 +397,15 @@ DEPENDENCIES
392
397
scss_lint
393
398
sdoc
394
399
selenium-webdriver
400
+ shakapacker (= 6.0.2 )
395
401
spring
396
402
spring-commands-rspec
397
403
uglifier
398
404
web-console
399
405
webdrivers (= 3.9.4 )
400
- webpacker (= 6.0.0.rc.6 )
401
406
402
407
RUBY VERSION
403
- ruby 2.7.3p183
408
+ ruby 2.7.5p203
404
409
405
410
BUNDLED WITH
406
411
2.1.4
Original file line number Diff line number Diff line change 2
2
# You can run these commands in separate shells
3
3
redis: redis-server
4
4
rails: bundle exec rails s -p 3000
5
- wp-client: HMR=true RAILS_ENV=development NODE_ENV=development bin/webpack -dev-server
6
- wp-server: bundle exec rake react_on_rails:locale && HMR=true SERVER_BUNDLE_ONLY=yes bin/webpack --watch
5
+ wp-client: HMR=true RAILS_ENV=development NODE_ENV=development bin/webpacker -dev-server
6
+ wp-server: bundle exec rake react_on_rails:locale && HMR=true SERVER_BUNDLE_ONLY=yes bin/webpacker --watch
Original file line number Diff line number Diff line change @@ -6,5 +6,5 @@ redis: redis-server
6
6
# When making frequent changes to client side assets, you will prefer building webpack assets
7
7
# upon saving rather than when you refresh your browser page.
8
8
# Note, if using React on Rails localization you will need to run
9
- # `bundle exec rake react_on_rails:locale` before you run bin/webpack
10
- webpack: sh -c 'bundle exec rake react_on_rails:locale && rm -rf public/packs/* || true && bin/webpack -w'
9
+ # `bundle exec rake react_on_rails:locale` before you run bin/webpacker
10
+ webpack: sh -c 'bundle exec rake react_on_rails:locale && rm -rf public/packs/* || true && bin/webpacker -w'
Original file line number Diff line number Diff line change 1
- // The source code including full typescript support is available at:
2
- // https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh/blob/master/babel.config.js
3
-
4
- const defaultConfigFunc = require ( '@rails/webpacker/package/babel/preset.js' ) ;
5
-
6
1
module . exports = function ( api ) {
7
- const resultConfig = defaultConfigFunc ( api ) ;
2
+ const defaultConfigFunc = require ( 'shakapacker/package/babel/preset.js' )
3
+ const resultConfig = defaultConfigFunc ( api )
4
+ const isProductionEnv = api . env ( 'production' )
8
5
9
6
const changesOnDefault = {
10
- plugins : [ process . env . WEBPACK_SERVE && 'react-refresh/babel' ] . filter ( Boolean ) ,
11
- } ;
7
+ presets : [
8
+ [
9
+ '@babel/preset-react' ,
10
+ {
11
+ development : ! isProductionEnv ,
12
+ useBuiltIns : true
13
+ }
14
+ ]
15
+ ] . filter ( Boolean ) ,
16
+ plugins : [
17
+ process . env . WEBPACK_SERVE && 'react-refresh/babel' ,
18
+ isProductionEnv && [ 'babel-plugin-transform-react-remove-prop-types' ,
19
+ {
20
+ removeImport : true
21
+ }
22
+ ]
23
+ ] . filter ( Boolean ) ,
24
+ }
12
25
13
- resultConfig . plugins = [ ...resultConfig . plugins , ...changesOnDefault . plugins ] ;
26
+ resultConfig . presets = [ ...resultConfig . presets , ...changesOnDefault . presets ]
27
+ resultConfig . plugins = [ ...resultConfig . plugins , ...changesOnDefault . plugins ]
14
28
15
- return resultConfig ;
16
- } ;
29
+ return resultConfig
30
+ }
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ require "webpacker"
6
6
require "webpacker/webpack_runner"
7
7
8
8
ENV [ "RAILS_ENV" ] ||= "development"
9
- ENV [ "NODE_ENV" ] ||= "development"
9
+ ENV [ "NODE_ENV" ] ||= ENV [ "RAILS_ENV" ]
10
10
ENV [ "BUNDLE_GEMFILE" ] ||= File . expand_path ( "../../Gemfile" , Pathname . new ( __FILE__ ) . realpath )
11
11
12
12
APP_ROOT = File . expand_path ( ".." , __dir__ )
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env ruby
2
2
3
3
ENV [ "RAILS_ENV" ] ||= "development"
4
- ENV [ "NODE_ENV" ] ||= "development"
4
+ ENV [ "NODE_ENV" ] ||= ENV [ "RAILS_ENV" ]
5
5
6
6
require "pathname"
7
7
ENV [ "BUNDLE_GEMFILE" ] ||= File . expand_path ( "../../Gemfile" ,
Original file line number Diff line number Diff line change 3
3
# https://github.com/rails/webpacker/pull/2018
4
4
5
5
To debug:
6
- bin/webpack --debug
6
+ bin/webpacker --debug-webpakcer
7
7
8
8
And put a debugger statement in the file you're editing.
9
9
Original file line number Diff line number Diff line change 2
2
// https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh/blob/master/config/webpack/commonWebpackConfig.js
3
3
4
4
// Common configuration applying to client and server configuration
5
- const { webpackConfig : baseClientWebpackConfig , merge } = require ( '@rails/webpacker ' ) ;
5
+ const { webpackConfig : baseClientWebpackConfig , merge } = require ( 'shakapacker ' ) ;
6
6
7
7
const commonOptions = {
8
8
resolve : {
You can’t perform that action at this time.
0 commit comments