Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const client = getApolloClient();
const jsx = (
);
const helmet = Helmet.renderStatic();
// Generate script tags
const scripts = manifest.client ? `
`
: ``;
const gtag = `
`;
renderToStringWithData(jsx)${
config('progressive.enabled')
? ``
: ''
}
${helmet.title.toString()}
${helmet.meta.toString()}
${helmet.link.toString()}
`,
scripts: `
${config('polyfillIo.enabled') &&
``}
`,
})
res.set({ 'Cache-Control': 'no-cache' })
res.send(
minify(document, {
removeAttributeQuotes: true,
collapseWhitespace: true,
})
)
}
let styles = '';
let scripts = `
`;
const isProd = process.env.NODE_ENV === 'production';
if(isProd) {
styles = `
`;
scripts = `
`
}
const history = createMemoryHistory();
const authenticated = false;
//const authenticated = req.isAuthenticated();
const user = null;
/*storeInitialState.user.authenticated = authenticated;
storeInitialState.user.user = user;
storeInitialState.app.host = req.clientConfig.host;
storeInitialState.app.site = req.clientConfig.site;*/
const metaProperties = {//eslint-disable-next-line
const manifest = require("../../dist/client/manifest.json");
const vendorCss = [manifest["vendors.css"], manifest["browser.css"]];
const vendorJs = [manifest["vendors.js"], manifest["browser.js"]];
export default ({ html, preState, helmet, bundles }) => {
let styles = bundles.filter(bundle => bundle.file.endsWith(".css"));
let scripts = bundles.filter(bundle => bundle.file.endsWith(".js"));
return `