-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: timestamp config dynamicImport #13502
Conversation
Run & review this pull request in StackBlitz Codeflow. |
/ecosystem-ci run sveltekit |
Buffer.from(`${bundledCode}\n//${configTimestamp}`).toString( | ||
'base64', | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this would affect sourcemaps since we're bundling with esbuild with sourcemap: 'inline'
, but I'm also not sure if we're using the sourcemap in anyway 🤔
Other than that this looks good to me though, nice find with the issue! I also wonder if doing a (Actually I think we'd need a deep clone){ ...config }
would also fix the issue if it's an object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya, I also thought of trying to do a deep clone. Or reviewing our code to avoid modifying the config somehow. But doing a new import here seems safer. The config could have side effects like a variable with a timestamp that won't be unique per config. State could be shared if they are defined as global for example.
Description
SvelteKit is failing after #13269, as
config.build.ssr
is mutated then the object is cached by Node. This PR makes sure the dynamic import config module is always different by adding a timestamp.What is the purpose of this pull request?