-
Notifications
You must be signed in to change notification settings - Fork 136
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
Adds Browsersync and scripts #587
Conversation
Some afternoon updates: SVGsSVG copy and This took adding a second pattern to the Copy Webpack Plugin in our Webpack config file. Now, when you're running Next, I added the This all occurs without creating a lot of overhead like we were seeing in #586 (cc @aubreypwd). Saving a Sass partial still takes < 4 seconds as we're not forcing everything to rebuild on file change. Other notesBrowsersync still runs when saving a PHP file and is generally quick. As noted above, saving a Sass partial doesn't take any longer than it currently does. All in all, so far we're adding two packages:
Again, we can discuss whether or not we want to explore using other packages or move any of this to the WDS Next StepsI really want to be able to generate Tailwind styles if you add a Tailwind class to the markup somewhere without making Browsersync take a hundred years. Going to mess around with |
I think I don't want this to get too hung up, and I feel like hammering on the remaining Tailwind item could do that. I'm going to take this out of draft and send it over for review – and then we can iterate on our Tailwind workflow as we go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, and this works great. Thanks @coreymcollins!
Closes #568 #583
I believe this will also close #586 which was initially started by @aubreypwd. Adding him as a reviewer as well to check this out.
DESCRIPTION
Adds Browsersync and adjusts our npm scripts to utilize it. If we decide to venture in another direction rather than Browsersync, that's totally fine but this was a part of our previous workflow and was a fairly streamlined addition (so far).
As noted in the task linked above, there isn't any live reload/Browsersync integration. This adds Browsersync back in and:
start:sync
. If you don't want to use Browsersync, just runnpm run start
; if you want to use Browsersync, runnpm run start:sync
/build/
directory rather than listening for changes in the/src/
directory. As I've found in my testing so far, this makes for a much quicker reload in the browser. I'm not necessarily sure why one is faster than the other since everything still needs to compile, but it seems to work! Maybe because we're listening for fewer files and directories? ¯\_(ツ)_/¯What this does NOT do yet:
bg-blue-600
to theheader
, you'll get a browser reload and you'll see the class in the markup but the Tailwind styles aren't compiled. These styles only get compiled onbuild
right now, and I'd love to have a way to get them to compile onstart:sync
without too much of a lag in reloading the browsersrc/images/icons
directory and copy new files to thebuild
directory or generate thesprite.svg
fileOTHER
STEPS TO VERIFY
npm i
npm run start:sync
src/images/
directoryDOCUMENTATION
Will this pull request require updating the wd_s wiki?
Yes, this will require some updates if we decide to merge it in.