Sha256: 017b960ce72109b10f3760e7e62f6bae2b4d53bc59a49c9b5b6d9a92ea9cd362

Contents?: true

Size: 799 Bytes

Versions: 5

Compression:

Stored size: 799 Bytes

Contents

# frozen_string_literal: true

# rubocop:disable all

TEMPLATE_PATH = File.expand_path("./tailwindcss", __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

run "yarn add -D tailwindcss"
run "npx tailwindcss init"

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

prepend_to_file "frontend/styles/index.css",
                File.read("#{TEMPLATE_PATH}/css_imports.css")

run "bundle exec bridgetown configure purgecss"

# 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/tailwindcss.rb
bridgetown-core-0.21.0.beta1 lib/bridgetown-core/configurations/tailwindcss.rb
bridgetown-core-0.20.0 lib/bridgetown-core/configurations/tailwindcss.rb
bridgetown-core-0.19.3 lib/bridgetown-core/configurations/tailwindcss.rb
bridgetown-core-0.19.2 lib/bridgetown-core/configurations/tailwindcss.rb