-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Split vendor css into its own file #598
Comments
Hi, I solved that by changing build/webpack.prod.conf.js, lines 69-77, from: return (
module.resource &&
/\.js$/.test(module.resource) &&
module.resource.indexOf(
path.join(__dirname, '../node_modules')
) === 0
)
} to: return (
module.resource &&
(/\.js$/.test(module.resource) ||
/\.css$/.test(module.resource)) &&
module.resource.indexOf(
path.join(__dirname, '../node_modules')
) === 0
)
} notice the "/.css$/.test(module.resource)) &&" line. Let me know if it's working for you, because I only did minimal testing on it. |
When you do this make sure to also include .vue in the regex check, otherwise this will cause issues with css that's extracted from vendor .vue files during build. Found this out the painful way. |
@bartcorremans thanks for the tip. Have you been running this without problem for some time? Should I just amend my PR with |
This is something I just stumbled upon today when importing a third-party .vue file. The generated output seems ok with this change but it's not something that I've been using in production for an extended time. |
Alright, leaving this without |
Since this doesn't seem to be well-tested I will close this and not merge the PR. |
This is a followup to bootstrap-vue/bootstrap-vue#143 - Document including Bootstrap CSS, in which I'm asking for advice to integrate CSS dependencies into my
vuejs-templates/webpack
-based app.In comment bootstrap-vue/bootstrap-vue#143 (comment), I'm advised to configure my webpack build to emit two separate bundles
app.css
andvendor.css
. This for the same reasons it's done for the js, in order to:vendor.<hash>.css
as cache-friendly as possible.I'm now looking at my webpack build configuration, which is mostly this template untouched, and I don't think this is currently baked in it.
Thanks.
The text was updated successfully, but these errors were encountered: