Sha256: 71cf0d80b778d22914611cdbea25e11c5c369fc268f6018803feacffdbd8c8df

Contents?: true

Size: 823 Bytes

Versions: 9

Compression:

Stored size: 823 Bytes

Contents

# frozen_string_literal: true

# rubocop:disable all

unless File.exist?("postcss.config.js")
  error_message = "#{"postcss.config.js".bold} not found. Please configure postcss in your project."

  @logger.error "\nError:".red, "🚨 #{error_message}"
  @logger.info "\nRun #{"bridgetown webpack enable-postcss".bold.blue} to set it up.\n"

  return
end

confirm = ask "This configuration will ovewrite your existing #{"postcss.config.js".bold.white}. Would you like to continue? [Yn]"
return unless confirm.casecmp?("Y")

plugins = %w(postcss-easy-import postcss-mixins postcss-color-function cssnano)

say "Adding the following PostCSS plugins: #{plugins.join(' | ')}", :green
run "yarn add -D #{plugins.join(' ')}"

copy_file in_templates_dir("postcss.config.js"), "postcss.config.js", force: true

# rubocop:enable all

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
bridgetown-core-1.0.0 lib/bridgetown-core/configurations/bt-postcss.rb
bridgetown-core-1.0.0.beta3 lib/bridgetown-core/configurations/bt-postcss.rb
bridgetown-core-1.0.0.beta2 lib/bridgetown-core/configurations/bt-postcss.rb
bridgetown-core-1.0.0.beta1 lib/bridgetown-core/configurations/bt-postcss.rb
bridgetown-core-1.0.0.alpha11 lib/bridgetown-core/configurations/bt-postcss.rb
bridgetown-core-1.0.0.alpha10 lib/bridgetown-core/configurations/bt-postcss.rb
bridgetown-core-1.0.0.alpha9 lib/bridgetown-core/configurations/bt-postcss.rb
bridgetown-core-1.0.0.alpha8 lib/bridgetown-core/configurations/bt-postcss.rb
bridgetown-core-1.0.0.alpha7 lib/bridgetown-core/configurations/bt-postcss.rb