vite_ruby 3.5.0 → 4.0.0.alpha1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class ViteRuby::CLI::SSR < ViteRuby::CLI::Vite
4
- DEFAULT_ENV = CURRENT_ENV || 'production'
5
- JS_EXTENSIONS = %w[js mjs cjs]
6
-
7
- desc 'Run the resulting app from building in SSR mode.'
8
- executable_options
9
-
10
- def call(mode:, inspect: false, trace_deprecation: false)
11
- ViteRuby.env['VITE_RUBY_MODE'] = mode
12
-
13
- ssr_entrypoint = JS_EXTENSIONS
14
- .map { |ext| ViteRuby.config.ssr_output_dir.join("ssr.#{ ext }") }
15
- .find(&:exist?)
16
-
17
- raise ArgumentError, "No ssr entrypoint found `#{ ViteRuby.config.ssr_output_dir.relative_path_from(ViteRuby.config.root) }/ssr.{#{ JS_EXTENSIONS.join(',') }}`. Have you run bin/vite build --ssr?" unless ssr_entrypoint
18
-
19
- cmd = [
20
- 'node',
21
- ('--inspect-brk' if inspect),
22
- ('--trace-deprecation' if trace_deprecation),
23
- ssr_entrypoint,
24
- ]
25
- Kernel.exec(*cmd.compact.map(&:to_s))
26
- end
27
- end