platformsh / legacy-cli

This is the legacy version of Platform.sh's command-line interface. The new version is at: https://github.com/platformsh/cli
https://docs.platform.sh/administration/cli.html
MIT License
224 stars 121 forks source link

Theme rebuild workflow / directories question #542

Open webprogrammierer opened 7 years ago

webprogrammierer commented 7 years ago

My theme is located in /my-platformsh-project/themes/custom/my_theme and I am using a my_profile.info and my_profile.install file.

After building the platform locally with platform build -c the theme has been copied to /my-platformsh-project/.platform/local/build/default/public/my_profile/themes/custom/my_theme

My theme directory contains a gulpfile.js and I am using gulp-sass for css.

How can I make changes to my css and see the changes in my browser?

If I make the changes in /my-platformsh-project/themes/custom/my_theme gulp generates the css files, but I can not see the changes in my browser, drupal uses the theme in /my-platformsh-project/.platform/local/build/default/public/my_profile/themes/custom/my_theme I would have to run platform build -c after every css change. This is impossible (build lasts about 10-15 minutes).

If I make changes in /my-platformsh-project/.platform/local/build/default/public/my_profile/themes/custom/my_theme maybe I can see the changes in my browser, but this directory will be overwritten at the next platform build.

What is the correct workflow?

pjcdawkins commented 7 years ago

That's why platform build (with no options) uses symlinks; to help ease this pain. But you'd still need to recompile the CSS when you edit your SASS. I believe you could set up a file watcher which looks at CSS files in directory x and compiles them in directory y whenever they are changed, but I'm not very frontendy so I don't recall exactly how...

Theoretically, in a perfect world, rebuilding/recompiling after every change is the best solution. The problem is the length of the build, so... you'd need to find a way to make those builds as fast as possible. That may not be practical right now.

pjcdawkins commented 7 years ago

If you merely want to tweak a little bit of CSS and see the changes immediately so that you can try things out (before editing your SASS later), you could just edit styles in your browser's developer tools.

webprogrammierer commented 7 years ago

It is not possible to make the build faster, "platform build" takes very long time and there is no way to make it faster.

Yes, I was testing this way (edit css instead of scss), but this is only for testing.

I am not able to make the platform build without option -c, because my browser is under Windows (using vagrant ubunto box) and something does not work without this option -c, mybe the symlinks make some problems in Windows.