Sha256: afacde31141f0828b06c66a71aa991826d0b4928fa75a74d6fbeaf78cd0e7dea

Contents?: true

Size: 779 Bytes

Versions: 5

Compression:

Stored size: 779 Bytes

Contents

# frozen_string_literal: true

# rubocop:disable all

TEMPLATE_PATH = File.expand_path("./bt-postcss", __dir__)

begin
  find_in_source_paths("postcss.config.js")
rescue Thor::Error
  error_message = "#{"postcss.config.js".bold} not found. Please configure postcss in your project."

  @logger.error "\nError:".red, "🚨 #{error_message}"
  @logger.info "\nFor new projects, you can use #{"bridgetown new my_project --use-postcss".bold.blue}\n"

  return
end

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(' ')}"

remove_file "postcss.config.js"
copy_file "#{TEMPLATE_PATH}/postcss.config.js", "postcss.config.js"

# rubocop:enable all

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bridgetown-core-0.21.0.beta2 lib/bridgetown-core/configurations/bt-postcss.rb
bridgetown-core-0.21.0.beta1 lib/bridgetown-core/configurations/bt-postcss.rb
bridgetown-core-0.20.0 lib/bridgetown-core/configurations/bt-postcss.rb
bridgetown-core-0.19.3 lib/bridgetown-core/configurations/bt-postcss.rb
bridgetown-core-0.19.2 lib/bridgetown-core/configurations/bt-postcss.rb