Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/registry/__tests__/addon-registry.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ describe('AddonRegistry - Project', () => {
'@plone/volto/LanguageSwitcher': `${base}/src/customizations/LanguageSwitcher.js`,
'@plone/volto/TSComponent': `${base}/src/customizations/TSComponent.jsx`,
'@plone/volto/client': `${base}/src/customizations/client.js`,
// .cjs is shadowable, and the alias key keeps its extension because
// such modules are imported with it. See #8366.
'@plone/volto/constants/Languages.cjs': `${base}/src/customizations/constants/Languages.cjs`,
'@plone/volto/routes': `${base}/src/customizations/routes.tsx`,
'test-addon/testaddon': `${base}/src/custom-addons/test-addon/testaddon.js`,
'@plone/volto/server': `${base}/src/customizations/server.jsx`,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { en: 'English', sv: 'Svenska' };
1 change: 1 addition & 0 deletions packages/registry/news/8366.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Include `.cjs` and `.mjs` in the customizations glob so core modules with those extensions can be shadowed. @kunalKumar-13
2 changes: 1 addition & 1 deletion packages/registry/src/addon-registry/addon-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ class AddonRegistry {

reg.forEach(({ customPath, name, sourcePath }) => {
glob(
`${customPath}/**/*.*(svg|png|jpg|jpeg|gif|ico|less|js|jsx|ts|tsx)`,
`${customPath}/**/*.*(svg|png|jpg|jpeg|gif|ico|less|js|jsx|ts|tsx|cjs|mjs)`,
).map((filename) => {
function changeFileExtension(filePath: string) {
// Extract the current file extension
Expand Down
Loading