Sha256: ecb964ec4afc5be002dd9151f21092708bbfed8928f6cea8fce951bd3459dad7

Contents?: true

Size: 847 Bytes

Versions: 1

Compression:

Stored size: 847 Bytes

Contents

# frozen_string_literal: true

template "esbuild.defaults.js.erb", "config/esbuild.defaults.js", force: true
copy_file "jsconfig.json"

unless File.read("package.json").include?('"type": "module"')
  insert_into_file "package.json",
                   after: '"private": true,' do
    <<-JS.chomp

  "type": "module",
    JS
  end
end

gsub_file "postcss.config.js", "module.exports =", "export default"
gsub_file "esbuild.config.js", 'const build = require("./config/esbuild.defaults.js")',
          'import build from "./config/esbuild.defaults.js"'
add_npm_package "esbuild@latest glob@latest" unless Bridgetown.env.test?

say "\nšŸŽ‰ esbuild configuration updated successfully!"
say "You may need to add `$styles/` to the front of your main CSS imports."
say "See https://www.bridgetownrb.com/docs/frontend-assets#esbuild-setup for details."

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bridgetown-core-2.0.0.beta3 lib/bridgetown-core/commands/esbuild/update.rb