Fix webpack CopyPlugin: rewrite icons path instead of deleting entry

Previous sed deleted lines which broke the webpack config syntax.
Instead, rewrite the `from:` path to point at the pre-copied icons
directory which webpack can access without following Nix store symlinks.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erich Blume 2026-03-26 14:56:55 -07:00
commit 78a89d7ed1

View file

@ -35,9 +35,9 @@ let
cp -rL ../../node_modules/@grafana/ui/dist/public/img/icons \
public/build/grafana/build/img/
# Remove the CopyPlugin icons entry from webpack config so it doesn't
# fail on the symlinked glob
sed -i "/from: 'node_modules\/@grafana\/ui\/dist\/public\/img\/icons'/,/to:/d" \
# Rewrite the CopyPlugin icons path to point at our pre-copied location
# instead of the symlinked node_modules path that webpack can't glob
sed -i "s|from: 'node_modules/@grafana/ui/dist/public/img/icons'|from: 'public/build/grafana/build/img/icons'|" \
scripts/webpack/webpack.common.js
yarn --offline build