Skip to content

Commit

Permalink
Fix migrate-from-webpack process (bridgetownrb#573)
Browse files Browse the repository at this point in the history
* 1.1.0 beta2 supports SASS, so there's no need to fail early on SASS
  present
* postcss-load-config released version 4 with breaking changes to API,
  which makes the esbuild config not working with it. Pinning version to
  last known working.
  • Loading branch information
katafrakt authored Jun 8, 2022
1 parent 1ff84ba commit 559768c
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

# rubocop:disable Layout/LineLength

if package_json["devDependencies"].key?("sass")
say "Unable to migrate, project uses Sass. Please migrate to PostCSS first before migrating to esbuild."
return
end

remove_file "webpack.config.js"
remove_file "config/webpack.defaults.js"

Expand All @@ -16,7 +11,7 @@
template default_postcss_config, "postcss.config.js"

unless Bridgetown.environment.test?
required_packages = %w(esbuild glob postcss postcss-flexbugs-fixes postcss-preset-env postcss-import postcss-load-config)
required_packages = %w(esbuild glob postcss postcss-flexbugs-fixes postcss-preset-env postcss-import postcss-load-config@3.1.4)
redundant_packages = %w(esbuild-loader webpack webpack-cli webpack-manifest-plugin webpack-merge css-loader file-loader mini-css-extract-plugin postcss-loader)

say "Installing required packages"
Expand Down

0 comments on commit 559768c

Please sign in to comment.