Open zzetao opened 4 years ago
@zzetao
The cache of vue-loader
completely depends on the cache-loader
, so the cacheDirectory/cacheIdentifier
here has no effect.
You can verify whether the vue-loader cache is generated through the node_modules/.cache
directory.
As for why chainWebpack did not delete the options parameter of vue-loader, just because you did not delete it. 😂
@fxxjdedd
Thanks for the reply.
I found from the source code and documentation that vue-loader
can be cached with cacheDirectory/cacheIdentifier
.
documentation: https://github.com/vuejs/vue-loader/blob/bcee5b9127/docs/options.md#cachedirectory--cacheidentifier
At first, I thought that disabling cache from rule(vue).uses.delete('cache-loader')
would do the trick
When I think about it, removing cache-loader
from chainWebpack rule(vue)
and disabling cache with vue-loader
are two things.
@zzetao Thanks for the correction, vue-loader's handling of cache is more complicated than I thought
Version
4.4.1
Environment info
What is expected?
I want to remove support for
cache-loader
on rule('vue') byconfig.module.rule('vue').uses.delete('cache-loader')
.What is actually happening?
But I found that the
vue-loader
keeps go through cache because it still setscacheDirectory / cacheIdentifier
.code: https://github.com/vuejs/vue-cli/blob/34f303b0b6a03f96e8c21d308931219154a7e627/packages/%40vue/cli-service/lib/config/base.js#L90-L105
Steps to reproduce
Here's my solution:
I don't think it is a bug, but it makes me wonder at first 🤔, is there a better solution?