-
-
Notifications
You must be signed in to change notification settings - Fork 630
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add custom_compile setting for webpacker.yml
The custom compile setting is necessary to prevent the default pre-compile task from running.
- Loading branch information
Showing
7 changed files
with
21 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,5 @@ | ||
# frozen_string_literal: true | ||
# This file is no longer used, as the default precompile task works. | ||
|
||
# lib/tasks/assets.rake | ||
# The webpack task must run before assets:environment task. | ||
# Otherwise Sprockets cannot find the files that webpack produces. | ||
# This is the secret sauce for how a Heroku deployment knows to create the webpack generated JavaScript files. | ||
Rake::Task["assets:precompile"] | ||
.clear_prerequisites | ||
.enhance(["assets:compile_environment"]) | ||
|
||
namespace :assets do | ||
# In this task, set prerequisites for the assets:precompile task | ||
task compile_environment: :webpack do | ||
Rake::Task["assets:environment"].invoke | ||
end | ||
|
||
desc "Compile assets with webpack" | ||
task :webpack do | ||
sh "cd client && yarn run build:client" | ||
|
||
# Skip next line if not doing server rendering | ||
sh "cd client && yarn run build:server" | ||
end | ||
|
||
task :clobber do | ||
rm_r Dir.glob(Rails.root.join("app/assets/webpack/*")) | ||
end | ||
end | ||
# Create a file, per `docs/additional-reading/heroku-deployment.md` if you wish to customize | ||
# the deployment precompile task. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters