Skip to content

fix can not find chunk in some case #3

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

Merged
merged 2 commits into from
Jan 8, 2018

Conversation

gxlmyacc
Copy link
Contributor

fix chunk canot find when chunk name like "styles/test.css?db562740a398ac3c4f42e7d579e5b365"

@mike1808
Copy link
Contributor

This solution looks very specific. I think stripping out everything after extenssion and leaving the old code will work better.

@gxlmyacc
Copy link
Contributor Author

gxlmyacc commented Dec 30, 2017

yeah, but I think the original code file.endsWith('.css') looks also specific.
or there's another way to do it, like this:

{ 
   inject: 'head'
   fileResolver (assetsByChunkName, publicPath, file) {
     if (file) return file;
     return assetsByChunkName[name].find(file => file.indexOf('.css') >= 0 && file.indexOf('.css.map') < 0);
   } 
}

@mike1808
Copy link
Contributor

mike1808 commented Jan 8, 2018

@gxlmyacc I like the current version more than the "fileResolver" option. I will merge it. Thank you!

@mike1808 mike1808 merged commit 8ddb885 into teamable-software:master Jan 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants