Sha256: 1ceeb41d435fd7298ce8bd3580689197b293c9487f7169c959d68f919e1664b7

Contents?: true

Size: 1.6 KB

Versions: 1

Compression:

Stored size: 1.6 KB

Contents

<%- if defined?(Rails) -%>
Rails.application.config.middleware.insert_before 0, ViteRb::Proxy, {ssl_verify_none: true}
<%- end -%>

ViteRb.configure do |vite|
  # Where to build vite to (out dir)
  vite.build_dir = "public"

  # url to use for assets IE: /vite/xyz.css, gets built to public/frontend
  vite.output_dir = "vite"

  # Where to find the config directory
  <%- if defined?(Rails) -%>
  vite.config_path = Rails.root.join("config", "vite")
  vite.mount_path = Rails.root.join("app", "vite")
  vite.manifest_file = Rails.root.join(vite.build_dir, vite.output_dir, "manifest.json")
  <%- else -%>
  vite.config_path = File.join("config", "vite")
  vite.mount_path = File.join("app", "vite")
  vite.manifest_file = File.join(vite.build_dir, vite.output_dir, "manifest.json")
  <%- end -%>

  # Where to find the snowpack config file
  vite.config_file = File.join(vite.config_path, "snowpack.config.js")

  # Where to find the babel config file
  vite.babel_config_file = File.join(vite.config_path, "babel.config.js")

  # Where to find the postcss config file
  vite.postcss_config_file = File.join(vite.config_path, "postcss.config.js")

  # Where to find your snowpack files
  vite.entrypoints_dir = "entrypoints"

  # What port to run vite with
  vite.port = "4035"

  # What hostname to use
  vite.hostname = "localhost"

  # Whether or not to use https
  # https://www.snowpack.dev/#https%2Fhttp2
  vite.https = false
end

<%- if defined?(Rails) -%>
ActiveSupport.on_load :action_controller do
  ActionController::Base.helper ViteRb::Helpers
end

ActiveSupport.on_load :action_view do
  include ViteRb::Helpers
end
<%- end -%>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vite_rb-0.0.1.alpha1 lib/vite_rb/templates/vite.rb.tt