Closed Cyclodex closed 4 years ago
What specific fileWatch and browserSync custom options have you found to be helpful for your projects?
Generally, these changes look good. Either you or I will need to apply them to the latest code with some brief testing.
We should re-use the already existing getConfig function, I will do this later.
Hi @mpetrovich , I finally got the time to update the code. I also fixed the duplication code, and made the getConfig function exportable and reusable. I also added a test for this function. We could further improve it and make the default config loaded within the function instead of before the function, but let's keep this PR small. We could split up the functionality (of the whole stylemark app) a bit better to generate more tests more easily, but I am not sure how you are thinking about that...
Please review & test.
To the project setup I have, and how the config settings would help:
Its a bit a complicated setup, related to Visual Studio Solutions / Projects setup... ;) I changed the names so it is an example and not real data.
Lets ignore why its like that, I just took this over ;) So now to make things work more smoother with the styleguide, I use options like that:
fileWatchPaths:
- SubProjectB.Web\Content\src\
- SubProjectB.Web\Scripts\src\XYScripts
browserSyncOptions:
files:
- SubProjectB.Web/Styleguide/*.*
excludeDir:
- dist
baseDir: SubProjectB.Web
assets:
- Content\images
Without this, I had a not well performing styleguide because of so many files laying around.
Hope this helps. Maybe we should have some example data in a branch or similar to test better... Because the current branch does not have any example setup or data for better testing...
Context
We are using the styleguide as part of a bigger project, which doesn't allow to use the styleguide as straight forward. To improve the performance I made the fileWatchPaths and BrowserSync options available to the configuration, allow to be more precise. On the browsr, it also looks not necessary to watch for all files outside of the output directory.
My styleguide is now crashing much less and the performance is much better.
Changes
Adding new config options to add
This allows to be more precise with watching for files and improves performance if done correctly. Documentation still needs some examples, if you like it.
Example config entries
Here a quick example settings:
If you like it this change, feel free to review and accept this PR ;)
Feature Sponsored by
This feature/PR is sponsored by the company I work: Garaio AG