diff --git a/app/assets/javascripts/discourse/ember-cli-build.js b/app/assets/javascripts/discourse/ember-cli-build.js index b1684a4e6e5..94b0fa5681b 100644 --- a/app/assets/javascripts/discourse/ember-cli-build.js +++ b/app/assets/javascripts/discourse/ember-cli-build.js @@ -136,12 +136,19 @@ module.exports = function (defaults) { staticAppPaths: ["static"], packagerOptions: { webpackConfig: { - devtool: "source-map", + devtool: + process.env.CHEAP_SOURCE_MAPS === "1" + ? "cheap-source-map" + : "source-map", output: { publicPath: "auto", filename: `assets/chunk.[chunkhash].${cachebusterHash}.js`, chunkFilename: `assets/chunk.[chunkhash].${cachebusterHash}.js`, }, + optimization: { + // Disable webpack minimization. Embroider automatically applies terser after webpack. + minimize: false, + }, cache: isProduction ? false : { diff --git a/app/assets/javascripts/ember-cli-progress-ci/index.js b/app/assets/javascripts/ember-cli-progress-ci/index.js index 1c30a7e5c85..9b7de7cda85 100644 --- a/app/assets/javascripts/ember-cli-progress-ci/index.js +++ b/app/assets/javascripts/ember-cli-progress-ci/index.js @@ -42,7 +42,7 @@ module.exports = { ) { this._sameOutputCount++; } else { - this.project.ui.writeInfoLine("..." + (text ? `[${text}]` : ".")); + process.stderr.write("..." + (text ? `[${text}]` : ".") + "\n"); this._sameOutputCount = 0; } this._lastText = text; diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake index c7fb1ffac83..422896fbcec 100644 --- a/lib/tasks/assets.rake +++ b/lib/tasks/assets.rake @@ -17,8 +17,9 @@ task "assets:precompile:build" do heap_size_limit = check_node_heap_size_limit if heap_size_limit < 2048 - STDERR.puts "Node.js heap_size_limit (#{heap_size_limit}) is less than 2048MB. Setting --max-old-space-size=2048." - compile_command = "NODE_OPTIONS='--max-old-space-size=2048' #{compile_command}" + STDERR.puts "Node.js heap_size_limit (#{heap_size_limit}) is less than 2048MB. Setting --max-old-space-size=2048 and CHEAP_SOURCE_MAPS=1" + compile_command = + "JOBS=0 CI=1 NODE_OPTIONS='--max-old-space-size=2048' CHEAP_SOURCE_MAPS=1 #{compile_command}" end ember_env = ENV["EMBER_ENV"] || "production"