░▒▓████████████████████████████████▓▒░ ░▒▓█ ▓▒░ ░▒▓█ ~ S W A M P ~ ▓▒░ ░▒▓█ ▓▒░ ░▒▓████████████████████████████████▓▒░
pplmvsvm
LOCATION:
/var/www/canvas/lib/canvas/cdn/registry
☗ ROOT
↻ REFRESH
✎ CARVE FLESH
EDITING: webpack.rb
# frozen_string_literal: true # # Copyright (C) 2021 - present Instructure, Inc. # # This file is part of Canvas. # # Canvas is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation, version 3 of the License. # # Canvas is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU Affero General Public License for more # details. # # You should have received a copy of the GNU Affero General Public License along # with this program. If not, see <http://www.gnu.org/licenses/>. module Canvas module Cdn class Registry class Webpack def initialize(environment:, manifest: nil) @asset_dir = if environment == "production" "dist/webpack-production" else "dist/webpack-dev" end @manifest = manifest || load_manifest_from_disk @files = Set.new(@manifest.values.flatten.uniq) { |x| realpath(x) } end def available? !@manifest.empty? end def include?(realpath) @files.include?(realpath) end def scripts_for(bundle) if @manifest.key?(bundle) [realpath(@manifest[bundle])] else [] end end private def load_manifest_from_disk file = Rails.root.join("public/#{@asset_dir}/webpack-manifest.json") if file.exist? JSON.parse(file.read).freeze elsif Rails.env.production? raise "you must run \"webpack\" first" else {} end end def realpath(vfile) "/#{@asset_dir}/#{vfile}" end end end end end
CANCEL
Name
Type
Size
Modified
Actions
↩ ..
DIR
—
—
📄 gulp.rb
RB
2.1 KB
2023-09-24 03:36
EDIT
📄 webpack.rb
RB
1.9 KB
2023-09-24 03:36
EDIT