Skip to content

Commit

Permalink
Allows use of RAZZLE_PREFIX_PATH variable in development mode
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleybl committed Nov 4, 2024
1 parent e8889fe commit ccc0b0e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
12 changes: 6 additions & 6 deletions packages/volto/src/helpers/Html/Html.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ class Html extends Component {
const head = Helmet.rewind();
const bodyClass = join(BodyClass.rewind(), ' ');
const htmlAttributes = head.htmlAttributes.toComponent();
const shouldPrefix =
config.settings.prefixPath && process.env.NODE_ENV === 'production';

return (
<html lang={htmlAttributes.lang}>
Expand Down Expand Up @@ -124,29 +122,31 @@ class Html extends Component {
<link
rel="icon"
href={
(shouldPrefix ? config.settings.prefixPath : '') + '/favicon.ico'
(config.settings.prefixPath ? config.settings.prefixPath : '') +
'/favicon.ico'
}
sizes="any"
/>
<link
rel="icon"
href={
(shouldPrefix ? config.settings.prefixPath : '') + '/icon.svg'
(config.settings.prefixPath ? config.settings.prefixPath : '') +
'/icon.svg'
}
type="image/svg+xml"
/>
<link
rel="apple-touch-icon"
sizes="180x180"
href={
(shouldPrefix ? config.settings.prefixPath : '') +
(config.settings.prefixPath ? config.settings.prefixPath : '') +
'/apple-touch-icon.png'
}
/>
<link
rel="manifest"
href={
(shouldPrefix ? config.settings.prefixPath : '') +
(config.settings.prefixPath ? config.settings.prefixPath : '') +
'/site.webmanifest'
}
/>
Expand Down
3 changes: 1 addition & 2 deletions packages/volto/src/server.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,7 @@ server.get('/*', (req, res) => {
context={context}
location={req.url}
basename={
config.settings.prefixPath &&
process.env.NODE_ENV === 'production'
config.settings.prefixPath
? config.settings.prefixPath
: undefined
}
Expand Down
5 changes: 1 addition & 4 deletions packages/volto/src/start-client.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ import configureStore from '@plone/volto/store';
import { Api, persistAuthToken, ScrollToTop } from '@plone/volto/helpers';

export const history = createBrowserHistory({
basename:
config.settings.prefixPath && process.env.NODE_ENV === 'production'
? config.settings.prefixPath
: '/',
basename: config.settings.prefixPath ? config.settings.prefixPath : '/',
});

function reactIntlErrorHandler(error) {
Expand Down

0 comments on commit ccc0b0e

Please sign in to comment.