Sha256: 01a18f262758bae0d3e549f4a24996768357bb41af12acfc13c7a2af156dbbe8

Contents?: true

Size: 1.06 KB

Versions: 8

Compression:

Stored size: 1.06 KB

Contents

require "webpacker/configuration"

say "Copying coffee loader to config/webpack/loaders"
copy_file "#{__dir__}/loaders/coffee.js", Jets.root.join("config/webpack/loaders/coffee.js").to_s

say "Adding coffee loader to config/webpack/environment.js"
insert_into_file Jets.root.join("config/webpack/environment.js").to_s,
  "const coffee =  require('./loaders/coffee')\n",
  after: /require\(('|")@rails\/webpacker\1\);?\n/

insert_into_file Jets.root.join("config/webpack/environment.js").to_s,
  "environment.loaders.prepend('coffee', coffee)\n",
  before: "module.exports"

say "Updating webpack paths to include .coffee file extension"
insert_into_file Webpacker.config.config_path, "- .coffee\n".indent(4), after: /\s+extensions:\n/

say "Copying the example entry file to #{Webpacker.config.source_entry_path}"
copy_file "#{__dir__}/examples/coffee/hello_coffee.coffee",
  "#{Webpacker.config.source_entry_path}/hello_coffee.coffee"

say "Installing all Coffeescript dependencies"
run "yarn add coffeescript@1.12.7 coffee-loader"

say "Webpacker now supports Coffeescript 🎉", :green

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
jetpacker-0.7.0 lib/install/coffee.rb
jetpacker-0.6.0 lib/install/coffee.rb
jetpacker-0.5.0 lib/install/coffee.rb
jetpacker-0.4.2 lib/install/coffee.rb
jetpacker-0.4.1 lib/install/coffee.rb
jetpacker-0.4.0 lib/install/coffee.rb
jetpacker-0.3.0 lib/install/coffee.rb
jetpacker-0.2.0 lib/install/coffee.rb