Sha256: ae889ddcf4538833c0373152d5df8360a9739c472d9824d0068e02698db49070

Contents?: true

Size: 994 Bytes

Versions: 16

Compression:

Stored size: 994 Bytes

Contents

# frozen_string_literal: true

# rubocop:disable Layout/LineLength

required_packages = %w(esbuild esbuild-loader webpack@5.39.1 webpack-cli@4.7.2 webpack-manifest-plugin@3.1.1)
redundant_packages = %w(@babel/core @babel/plugin-proposal-class-properties @babel/plugin-proposal-decorators @babel/plugin-transform-runtime @babel/preset-env babel-loader)

template "webpack.defaults.js.erb", "config/webpack.defaults.js", force: true
say "🎉 Webpack configuration updated successfully!"

return if Bridgetown.environment.test?

say "Installing required packages"
run "yarn add -D #{required_packages.join(" ")}"

packages_to_remove = package_json["devDependencies"].slice(*redundant_packages).keys
unless packages_to_remove.empty?
  confirm = ask "\nThe following packages will be removed: \n\n#{packages_to_remove.join("\n")}\n\nWould you like to continue? [Yn]"
  return unless confirm.casecmp?("Y")

  run "yarn remove #{packages_to_remove.join(" ")}"
end

# rubocop:enable Layout/LineLength

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
bridgetown-core-1.0.0.alpha11 lib/bridgetown-core/commands/webpack/update.rb
bridgetown-core-1.0.0.alpha10 lib/bridgetown-core/commands/webpack/update.rb
bridgetown-core-1.0.0.alpha9 lib/bridgetown-core/commands/webpack/update.rb
bridgetown-core-1.0.0.alpha8 lib/bridgetown-core/commands/webpack/update.rb
bridgetown-core-1.0.0.alpha7 lib/bridgetown-core/commands/webpack/update.rb
bridgetown-core-1.0.0.alpha6 lib/bridgetown-core/commands/webpack/update.rb
bridgetown-core-1.0.0.alpha5 lib/bridgetown-core/commands/webpack/update.rb
bridgetown-core-0.21.5 lib/bridgetown-core/commands/webpack/update.rb
bridgetown-core-1.0.0.alpha4 lib/bridgetown-core/commands/webpack/update.rb
bridgetown-core-1.0.0.alpha3 lib/bridgetown-core/commands/webpack/update.rb
bridgetown-core-1.0.0.alpha2 lib/bridgetown-core/commands/webpack/update.rb
bridgetown-core-1.0.0.alpha1 lib/bridgetown-core/commands/webpack/update.rb
bridgetown-core-0.21.4 lib/bridgetown-core/commands/webpack/update.rb
bridgetown-core-0.21.3 lib/bridgetown-core/commands/webpack/update.rb
bridgetown-core-0.21.2 lib/bridgetown-core/commands/webpack/update.rb
bridgetown-core-0.21.1 lib/bridgetown-core/commands/webpack/update.rb