When we build docusaurus build, it creates a file as rumtime~main.[hash].js. The question is can we avoid ~? #10743
Unanswered
bharatmane
asked this question in
General
Replies: 1 comment
-
Tried this locally and this works: {
optimization: {
runtimeChunk: {
name: (entrypoint) => `runtime___${entrypoint.name}`,
},
},
}; https://webpack.js.org/configuration/optimization/#optimizationruntimechunk By default we use: optimization: {
runtimeChunk: true,
}, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When I run docusaurus build
It generate the site as expected and it works very well. However in the build folder it generates few files, among them there is one file which is
runtime~main.c20a87de.js
The problem with this naming convention, when i try to deploy it to the server and browse the documentation. The search box is not functional and when i checked the why? I san an browser error in console
Failed to load resource: the server responded with a status of 500.
This is because my server prohibits the name with tilt(~)
I tried multiple approaches to override but nothing seems working.
module.exports = function forceWebpackRuntimeConfig() { return { name: 'force-webpack-runtime-config', configureWebpack(config, isServer) { // Explicitly override runtimeChunk config.optimization.runtimeChunk = { name: () =>
runtime.[contenthash]`, // Generates runtime.[contenthash].js};
};
};`
I am trying to find if we can avoid the name being generated without tilt.
If you need more infromatio, please do let me know `
Beta Was this translation helpful? Give feedback.
All reactions