File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 1
1
namespace :javascript do
2
+ desc "Install JavaScript dependencies"
3
+ task :install do
4
+ unless system "yarn install"
5
+ raise "jsbundling-rails: Command install failed, ensure yarn is installed"
6
+ end
7
+ end
8
+
2
9
desc "Build your JavaScript bundle"
3
- task :build do
4
- unless system "yarn install && yarn build"
5
- raise "jsbundling-rails: Command build failed, ensure yarn is installed and `yarn build` runs without errors"
10
+ build_task = task :build do
11
+ unless system "yarn build"
12
+ raise "jsbundling-rails: Command build failed, ensure `yarn build` runs without errors"
6
13
end
7
14
end
15
+ build_task . prereqs << :install unless ENV [ "SKIP_YARN_INSTALL" ]
8
16
end
9
17
10
18
if Rake ::Task . task_defined? ( "assets:precompile" )
You can’t perform that action at this time.
0 commit comments