DEV: Fix javascript:update rake task (#17098)

* The `javascript:update` rake task failed because recent versions of chart.js use a lowercase filename (`chart.min.js` instead of `Chart.min.js`)

* Changed `loadScript()` to use lowercase keys to lookup scripts

* `svg-arrow.css` seems to have changed slightly (linebreak at the end of file)
This commit is contained in:
Gerhard Schlager
2022-06-15 19:49:04 +02:00
committed by GitHub
parent a7034c5a14
commit 888f50543d
6 changed files with 16 additions and 5 deletions

View File

@ -75,7 +75,7 @@ def dependencies
package_name: '@json-editor/json-editor',
public: true
}, {
source: 'chart.js/dist/Chart.min.js',
source: 'chart.js/dist/chart.min.js',
public: true
}, {
source: 'chartjs-plugin-datalabels/dist/chartjs-plugin-datalabels.min.js',
@ -310,7 +310,7 @@ task 'javascript:update' => 'clean_up' do
else
package_dir_name = public_path_name(f)
package_version = JSON.parse(File.read("#{library_src}/#{node_package_name(f)}/package.json"))["version"]
versions[filename] = "#{package_dir_name}/#{package_version}/#{filename}"
versions[filename.downcase] = "#{package_dir_name}/#{package_version}/#{filename}"
path = "#{public_js}/#{package_dir_name}/#{package_version}"
dest = "#{path}/#{filename}"