Run [npm run theme] after successful webpack build so sprites and pot files are built. #586
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This hooks into Webpack, and when a build is emitted, we run
npm run theme
so that pot files and sprites are re-generated into the build folder.Closes #583
DESCRIPTION
This solves #583 by ensuring that the WebPack build runs the commands we use to built the
sprite.svg
andlanguages/*.pot
files.The issue in #583 is that when you run
npm run theme
theme:icons
is ran which generates thebuild/images/icons/sprite.svg
file, but then onnpm run start
Webpack'sCopyWebpackPlugin
plugin essentially deletesbuild/images
and copiessrc/images/**
over. Ran in this order, thebuild/images/icons/sprite.svg
file is deleted in the process and never generated again.This solution fixes this by having Webpack run
npm run theme
afterCopyWebpackPlugin
plugin runs to re-generate thebuild/images/icons/sprite.svg
file.It also fixes another underlying (and related issue) where the POT files in
build/languages/*.pot
are built once whennpm run them
runs onpostinstall
but are never regenerated again. Additionally this fix fixes that too since pot files are generated to thebuild/languages/
folder onnpm run theme
.STEPS TO VERIFY
Running
node@12
clone the directory and runnpm i
then runnpm run start
and e.g. modify an SVG in insrc/images/icon
and notice that unlike in #583 thebuild/images/sprite.svg
file is no longer deleted onnpm run start
.DOCUMENTATION
Will this pull request require updating the wd_s wiki?
I don't think so.