File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -12,10 +12,22 @@ def copy_react_asset(webpack_file, destination_file)
1212 FileUtils . cp ( full_webpack_path , full_destination_path )
1313end
1414
15+ # Move to `dirname` and execute `yarn {cmd}`
16+ def yarn_run_in ( dirname , cmd )
17+ Dir . chdir ( dirname ) do
18+ `yarn #{ cmd } `
19+ end
20+ end
21+
1522namespace :react do
1623 desc 'Run the JS build process to put files in the gem source'
1724 task update : [ :install , :build , :copy ]
1825
26+ desc 'Install the JavaScript dependencies'
27+ task :install do
28+ yarn_run_in ( 'react-builds' , 'upgrade' )
29+ end
30+
1931 desc 'Build the JS bundles with Webpack'
2032 task :build do
2133 yarn_run_in ( 'react-builds' , 'build' )
@@ -29,11 +41,6 @@ namespace :react do
2941 copy_react_asset ( "#{ environment } /react-server.js" , "#{ environment } /react-server.js" )
3042 end
3143 end
32-
33- desc 'Install the JavaScript dependencies'
34- task :install do
35- yarn_run_in ( 'react-builds' , 'upgrade' )
36- end
3744end
3845
3946namespace :ujs do
You can’t perform that action at this time.
0 commit comments