Sha256: a5b78640dce994c3ccbd15eb1dfad682667fa22ce3683ff2884f1dd8a203016b

Contents?: true

Size: 1.34 KB

Versions: 2

Compression:

Stored size: 1.34 KB

Contents

require "webpacker/configuration"

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

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

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

say "Copying angular example entry file to #{Webpacker.config.source_entry_path}"
copy_file "#{__dir__}/examples/angular/hello_angular.js", "#{Webpacker.config.source_entry_path}/hello_angular.js"

say "Copying hello_angular app to #{Webpacker.config.source_path}"
directory "#{__dir__}/examples/angular/hello_angular", "#{Webpacker.config.source_path}/hello_angular"

say "Copying tsconfig.json to the Rails root directory for typescript"
copy_file "#{__dir__}/examples/angular/tsconfig.json", "tsconfig.json"

say "Installing all angular dependencies"
run "yarn add typescript ts-loader core-js zone.js rxjs @angular/core @angular/common @angular/compiler @angular/platform-browser @angular/platform-browser-dynamic"

say "Webpacker now supports angular and typescript 🎉", :green

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
webpacker-jets-3.2.101 lib/install/angular.rb
webpacker-jets-3.2.100 lib/install/angular.rb