module Webpacker::PNPM

Constants

VERSION

Public Instance Methods

default_watched_paths() click to toggle source
# File lib/webpacker/pnpm/patches.rb, line 12
def default_watched_paths
  [
    *config.resolved_paths_globbed,
    config.source_path_globbed,
    "pnpm-lock.yaml", "package.json",
    "config/webpack/**/*"
  ].freeze
end
load_tasks(_app = self) click to toggle source
# File lib/webpacker/pnpm/patches.rb, line 42
def load_tasks(_app = self)
  unfiltered_tasks
  # rather than clear the tasks, alias them to the new pnpm tasks so
  # that any external code will still run
  Rake::Task["webpacker:check_yarn"].clear.enhance(["webpacker:check_pnpm"])
  Rake::Task["webpacker:yarn_install"].clear.enhance(["webpacker:pnpm_install"])
  Rake::Task["webpacker:info"].clear.enhance(["webpacker:env"])
  Rake::Task["yarn:install"].clear.enhance(["webpacker:pnpm_install"])
end
run(command, config = {}) click to toggle source
Calls superclass method
# File lib/webpacker/pnpm/patches.rb, line 26
def run(command, config = {})
  cmd = command.to_s

  if cmd.include?("yarn")
    cmd.gsub!("yarn", "pnpm")
    cmd.gsub!("--dev", "--save-dev")
  end

  super(cmd, config)
end