Welcome to mirror list, hosted at ThFree Co, Russian Federation.

vite_helper.rb « helpers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: adb9ffa39e0fbfa7026dc777a95a23e013b2ddbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frozen_string_literal: true

module ViteHelper
  def vite_enabled?
    # vite is not production ready yet
    return false if Rails.env.production?
    # Enable vite if explicitly turned on in the GDK
    return Gitlab::Utils.to_boolean(ViteRuby.env['VITE_ENABLED'], default: false) if ViteRuby.env.key?('VITE_ENABLED')

    # Enable vite the legacy way (in case GDK hasn't been updated)
    # This is going to be removed with https://gitlab.com/gitlab-org/gitlab/-/issues/431041
    Rails.env.development? ? Feature.enabled?(:vite) : false
  end
end