Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Add build:ci npm build option

Oliver Günther6ea3d17bb2f3
diff --git a/frontend/package.json b/frontend/package.json
index ade02989bd2..e0757beb6ce 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -175,6 +175,7 @@
},
"scripts": {
"analyze": "ng build --configuration production --stats-json && webpack-bundle-analyzer -h 0.0.0.0 -p 9999 ../public/assets/frontend/stats.json",
+ "build:ci": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --configuration production --named-chunks --source-map=false --build-optimizer=false --optimization=false",
"build": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --configuration production --named-chunks --source-map",
"build:watch": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --watch --named-chunks",
"tokens:generate": "theo src/app/spot/styles/tokens/tokens.yml --transform web --format sass,json --dest src/app/spot/styles/tokens/dist",
diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake
index a90de7a9fe2..e840aadcc95 100644
--- a/lib/tasks/assets.rake
+++ b/lib/tasks/assets.rake
@@ -64,7 +64,8 @@ namespace :assets do
puts "Building angular frontend"
Dir.chdir Rails.root.join('frontend') do
- sh 'npm run build' do |ok, res|
+ cmd = ENV['CI'] ? 'npm run build:ci' : 'npm run build'
+ sh(cmd) do |ok, res|
raise "Failed to compile angular frontend: #{res.exitstatus}" if !ok
end
end