Add build:ci npm build option

This commit is contained in:
Oliver Günther
2023-05-15 21:00:21 +02:00
parent f4d5eccdac
commit 6ea3d17bb2
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -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",
+2 -1
View File
@@ -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