Sha256: e8c143b1a77f4d9d5697064c54117697d018c11fd36968f1a3515ebd4cdd1ab9

Contents?: true

Size: 1.11 KB

Versions: 8

Compression:

Stored size: 1.11 KB

Contents

require "webpacker/configuration"

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 "Installing all angular dependencies"
run "yarn add core-js zone.js rxjs @angular/core @angular/common @angular/compiler @angular/platform-browser @angular/platform-browser-dynamic"

if Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR > 1
  say "You need to enable unsafe-eval rule.", :yellow
  say "This can be done in Rails 5.2+ for development environment in the CSP initializer", :yellow
  say "config/initializers/content_security_policy.rb with a snippet like this:", :yellow
  say "if Rails.env.development?", :yellow
  say "  p.script_src :self, :https, :unsafe_eval", :yellow
  say "else", :yellow
  say "  p.script_src :self, :https", :yellow
  say "end", :yellow
end

say "Webpacker now supports angular 🎉", :green

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
webpacker-3.4.3 lib/install/angular.rb
webpacker-4.0.0.pre.pre.2 lib/install/angular.rb
webpacker-4.0.0.pre.pre.1 lib/install/angular.rb
webpacker-3.4.1 lib/install/angular.rb
webpacker-3.4.0 lib/install/angular.rb
webpacker-3.3.1 lib/install/angular.rb
webpacker-3.3.0 lib/install/angular.rb
webpacker-3.2.2 lib/install/angular.rb