Skip to content

Commit

Permalink
fix(shs-5963): change how theme shared js is handled
Browse files Browse the repository at this point in the history
  • Loading branch information
cienvaras committed Nov 27, 2024
1 parent f9c4a0b commit 70ab7c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ docroot/themes/humsci/humsci_colorful/css/humsci_colorful-ckeditor.css
docroot/themes/humsci/humsci_traditional/css/humsci_traditional-ckeditor.css
docroot/themes/humsci/humsci_colorful/css/humsci_colorful-preview.css
docroot/themes/humsci/humsci_traditional/css/humsci_traditional-preview.css
docroot/themes/humsci/humsci_basic/dist/js
docroot/themes/humsci/humsci_traditional/js
docroot/themes/humsci/humsci_colorful/js
# Ignore build artifacts
Expand Down
8 changes: 4 additions & 4 deletions docroot/themes/humsci/humsci_basic/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ module.exports = {
// Shared files have two entries, one for each theme.
Object.keys(shared).forEach((key) => {
const file = shared[key];
entries[`humsci_traditional.${key}`] = path.resolve(srcDir, file);
entries[`humsci_colorful.${key}`] = path.resolve(srcDir, file);
entries[`shared.${key}`] = path.resolve(srcDir, file);
});

// Traditional theme specific files.
Expand All @@ -43,9 +42,10 @@ module.exports = {
output: {
filename(pathData) {
const [theme, filename] = pathData.chunk.name.split('.');
return `${theme}/js/${filename}.js`;
const themePath = theme === 'shared' ? 'dist/js' : `../${theme}/js`;
return `${themePath}/${filename}.js`;
},
path: path.resolve(__dirname, '../'),
path: path.resolve(__dirname, '.'),
},
module: {
rules: [
Expand Down

0 comments on commit 70ab7c2

Please sign in to comment.