File yarn-use-no-production.patch of Package discourse
Index: discourse/bin/ember-cli
===================================================================
--- discourse.orig/bin/ember-cli
+++ discourse/bin/ember-cli
@@ -57,7 +57,7 @@ if !args.include?("test") && !args.inclu
end
# Running yarn install in the root directory will also run it for YARN_DIR via a post-install hook
-exit 1 if !system "yarn", "-s", "install", "--cwd", RAILS_ROOT
+exit 1 if !system "yarn", "-s", "install", "--cache-folder", "../../../../vendor/cache/yarn/", "--cwd", RAILS_ROOT
yarn_env = {}
if ARGV.include?("--forward-host")
Index: discourse/config/environments/production.rb
===================================================================
--- discourse.orig/config/environments/production.rb
+++ discourse/config/environments/production.rb
@@ -14,7 +14,8 @@ Discourse::Application.configure do
# Disable Rails's static asset server (Apache or nginx will already do this)
config.public_file_server.enabled = GlobalSetting.serve_static_assets || false
- config.assets.js_compressor = :uglifier
+ # turn off because it fails with the current code
+ config.assets.js_compressor = nil
# stuff should be pre-compiled
config.assets.compile = false
Index: discourse/lib/tasks/javascript.rake
===================================================================
--- discourse.orig/lib/tasks/javascript.rake
+++ discourse/lib/tasks/javascript.rake
@@ -204,7 +204,7 @@ end
task "javascript:update" => "clean_up" do
require "uglifier"
- system("yarn install", exception: true)
+ system("yarn install --cache-folder vendor/cache/yarn/", exception: true)
versions = {}
start = Time.now
Index: discourse/lib/tasks/svg_icons.rake
===================================================================
--- discourse.orig/lib/tasks/svg_icons.rake
+++ discourse/lib/tasks/svg_icons.rake
@@ -9,7 +9,7 @@ def library_src
end
task "svgicons:update" do
- system("yarn install", exception: true)
+ system("yarn install --cache-folder vendor/cache/yarn/", exception: true)
dependencies = [{ source: "@fortawesome/fontawesome-free/sprites", destination: "fontawesome" }]