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
Improve load performance #482
Conversation
604e564
to
91f9e7e
Compare
What kind of perf improvements did this yield? |
91f9e7e
to
25412d5
Compare
25412d5
to
a8c57c0
Compare
I wonder if we swapped got ~28kb |
@@ -66,8 +67,8 @@ export async function wrapCssModuleResponse({ | |||
hasHmr?: boolean; | |||
config: SnowpackConfig; | |||
}) { | |||
let core = new Core(); | |||
const {injectableSource, exportTokens} = await core.load(code, url, () => { | |||
_cssModuleLoader = _cssModuleLoader || new (require('css-modules-loader-core'))(); |
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.
We need to use require()
here, since TypeScript's import
support forces us to grab the default
export off of the module, but that doesn't actually exist. But, we still get type info from the CSSModuleLoader
type above.
+1, we only use |
Based off work from https://github.com/GoogleCloudPlatform/require-so-slow
These were our two worst offenders in terms of load time performance impact.