Sha256: 00079be4ab6d8b2e751009cdba959d4177c45b2a541c86cb4ca9392bd05e4f8e

Contents?: true

Size: 1.51 KB

Versions: 2

Compression:

Stored size: 1.51 KB

Contents

# Install webpacker
copy_file "#{__dir__}/config/webpacker.yml", "config/webpacker.yml"

puts "Copying webpack core config and loaders"
directory "#{__dir__}/config/webpack", "config/webpack"
directory "#{__dir__}/config/loaders/core", "config/webpack/loaders"

puts "Copying .postcssrc.yml to app root directory"
copy_file "#{__dir__}/config/.postcssrc.yml", ".postcssrc.yml"

puts "Copying .babelrc to app root directory"
copy_file "#{__dir__}/config/.babelrc", ".babelrc"

puts "Creating javascript app source directory"
directory "#{__dir__}/javascript", "#{Webpacker::Configuration.source}"

puts "Copying binstubs"
directory "#{__dir__}/bin", "bin"

chmod "bin", 0755 & ~File.umask, verbose: false

if File.exists?(".gitignore")
  append_to_file ".gitignore", <<-EOS
/public/packs
/public/packs-test
/node_modules
EOS
end

puts "Installing all JavaScript dependencies"
run "yarn add webpack webpack-merge js-yaml path-complete-extname " \
"webpack-manifest-plugin babel-loader@7.x coffee-loader coffee-script " \
"babel-core babel-preset-env babel-polyfill compression-webpack-plugin rails-erb-loader glob " \
"extract-text-webpack-plugin node-sass file-loader sass-loader css-loader style-loader " \
"postcss-loader postcss-cssnext postcss-smart-import resolve-url-loader " \
"babel-plugin-syntax-dynamic-import babel-plugin-transform-class-properties " \
"babel-plugin-transform-object-rest-spread"

puts "Installing dev server for live reloading"
run "yarn add --dev webpack-dev-server"

puts "Webpacker successfully installed 🎉 🍰"

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
webpacker-react-on-rails-3.0.0.rc.1 lib/install/template.rb
webpacker-react-on-rails-2.0 lib/install/template.rb