Open clemyan opened 5 years ago
Upon further investigation, the assets
prop is considered internal and not part of the public API of Stats
. So reading the emitted code from the stats object directly is not compliant.
I guess the "proper" way is to hook into emit
using a Webpack plugin then.
Version
3.5.5
Reproduction link
https://github.com/clemyan/vue-cli-fs-repro
Environment info
Steps to reproduce
yarn build
What is expected?
Build finishes without error
What is actually happening?
An error is throw after assets are emitted. All assets are emitted properly.
The error is thrown from
@vue\cli-service\lib\commands\build\formatStats.js
while trying to print emitted assets info, because it attempts to read the emitted files from the real fs while the Webpack compiler could be using anoutputFileSystem
that does not write to real fs.Since
formatStats
is already passed aStats
instance, in Webpack 4 it can avoid reading the fs by reading the emitted code from the stats object directly.I have a use case in which I want to use webpack plugins to generate alternative assets (e.g. zip files) and avoid the cost of writing the app to the fs by using a custom outputFileSystem.