Skip to content

Commit

Permalink
Add build comments to webpack.config.js
Browse files Browse the repository at this point in the history
Co-authored-by: gabalafou <gabriel@fouasnon.com>
  • Loading branch information
trallard and gabalafou authored Nov 25, 2024
1 parent 0f3aa5c commit 85a8b51
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,18 @@ var config = {
};

module.exports = (env, argv) => {
// since STB isolates the build, we need to compile the translations here for releases
// Sphinx Theme Builder creates a completely isolated working directory
// when packaging the theme. That means that we cannot follow a workflow
// like this:
// 1. run command to compile the translations
// 2. run command to package the theme (`stb package`)
// We must instead compile the translations **as part of** the command
// that builds the theme:
// 1. command to package theme
// a. compile translations
// The theme builder calls `npm run-script build`, which we have configured
// to call `webpack --mode=production` (which calls this file), which is why
// we compile the translations here.
if (argv.mode === 'production') {
exec(`pybabel compile -d ${localePath} -D sphinx`, (error, stdout, stderr) => {
if (error) {
Expand Down

0 comments on commit 85a8b51

Please sign in to comment.