Sha256: 9b540ebe77187821c4c6be0266cccdae6b520ec4beb6a3893b56c48bc04e5af5

Contents?: true

Size: 878 Bytes

Versions: 8

Compression:

Stored size: 878 Bytes

Contents

require "webpacker/configuration"
require "fileutils"

replace_babel_config = FileUtils.compare_file(Jets.root.join("babel.config.js"), "#{__dir__}/config/babel.config.js")

say "Copying babel.config.js to app root directory"
copy_file "#{__dir__}/examples/react/babel.config.js", "babel.config.js", force: replace_babel_config

say "Copying react example entry file to #{Webpacker.config.source_entry_path}"
copy_file "#{__dir__}/examples/react/hello_react.jsx", "#{Webpacker.config.source_entry_path}/hello_react.jsx"

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

say "Installing all react dependencies"
run "yarn add react react-dom @babel/preset-react prop-types babel-plugin-transform-react-remove-prop-types"

say "Webpacker now supports react.js 🎉", :green

Version data entries

8 entries across 8 versions & 1 rubygems

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