Let jsbundling-rails expand without requiring a change in Rails

This commit is contained in:
David Heinemeier Hansson 2021-09-07 21:00:06 +02:00
parent 83808166e6
commit fa1a4b657c
1 changed files with 2 additions and 5 deletions

View File

@ -294,13 +294,10 @@ module Rails
def javascript_gemfile_entry
return [] if options[:skip_javascript]
case options[:javascript]
when "importmap"
if options[:javascript] == "importmap"
GemfileEntry.version("importmap-rails", ">= 0.3.4", "Manage modern JavaScript using ESM without transpiling or bundling")
when "webpack", "esbuild", "rollup"
GemfileEntry.version "jsbundling-rails", "~> 0.1.0", "Bundle and transpile JavaScript with esbuild, rollup.js, or Webpack. Read more: https://github.com/rails/jsbundling-rails"
else
raise "Unknown JavaScript approach: #{options[:javascript]} [options are: importmap, webpack, esbuild, rollup]"
GemfileEntry.version "jsbundling-rails", "~> 0.1.0", "Bundle and transpile JavaScript with a JavaScript bundler. Read more: https://github.com/rails/jsbundling-rails"
end
end