faceyspacey / faceyspacey/webpack-flush-chunks
reference script file outside of webpack build
- Dominant language
- JavaScript
- Stars
- 354
- Forks
- 30
- PR merge metrics
- No merged PRs in 30d
Description
I am server rendering my react app like this:
export default ({ clientStats }: { clientStats: any }) => async (req: Request, res: Response, next: any) => {
const context: any = {};
const app = (
);
if (context.url) {
res.writeHead(301, {
Location: context.url
});
res.end();
return;
}
const { styles, js, scripts } = flushChunks(clientStats, {
chunkNames: flushChunkNames()
});
const appString = renderToString(app);
const { title } = Helmet.renderStatic();
res.status(200).send(`
${styles}
${title}
`);
};
How can I reference a script that is outside of the webpack build?
I have an `init.js` file that does very little and I want to just reference it. I don't need it transpiled or anything.
Where can I put it so that when the html is rendered, the script tag resolves?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.