Closed tpraxl closed 4 years ago
Found it. It's not a bug:
First and foremost: The size module uses configs.size.threshold
settings for the folders to inspect. The configs.buildDir
seems to be irrelevant for it.
I had a typo (treshold instead of threshold) in my real life project and no configs.size.threshold
setting at all in my reduced "project" tests and in the examples to reproduce the issue.
That made the size module fall back to the default values (child folders of build
).
So I made the mistake. But it was extremely hard to spot. I needed to debug the code to find that using trial and error.
Makes me wonder if you should add a --debug
flag that prints out things like (using default values for config.size.threshold
) or (you have unrecognized config values in your yml: …
). Not sure though, if this would be worth the effort.
Anyways. At least, the size module should yell when there are configured folders that don't exist.
Thank you for reporting this @tpraxl. I can see opportunities for improving the docs, too. Contributions welcome (hint, hint 😄)
FYI, part of #146 was to fix this by changing the default config to use the buildDir
. I'll likely release this in a new minor version instead of just a patch but there are some other things that need to be prepped.
@mitchellsimoens thanks for the update
Describe the bug The size report behaves as if
build
buildDir was hardcoded:You can always see:
Size Checks [ success: ✓ ]
, but the actual files are missing if you're not working inbuild
.public
dir presentbuild
dir not presentbuildDir: public
public/index.html
public/index.html
public
dir presentbuild
dir presentbuildDir: public
public/index.html
build/index.html
public
dir not presentbuild
dir presentbuildDir: build
build/index.html
build/index.html
To Reproduce Steps to reproduce the behavior:
buildDir: public
gimbal
build
buildDir: public
)gimbal
build/index.html
is listed instead ofpublic/index.html
buildDir: build
gimbal
build/index.html
is listed as expectedI have attached a bash script. For each use case, it sets up the folders and runs gimbal, so that you can see the effect and inspect the files before proceeding to the next use case. Consider using it. (Extract and
chmod u+x setup-proof-of-bug.sh
. It will create a minimum "project" in the folderbuild-dir-bug
).Expected behavior
Files are always listed for the configured
buildDir
. (I.e.:buildDir: public
->public/index.html
is listed). Only if nobuildDir
is configured, it defaults tobuild
.Desktop (please complete the following information):
Additional context