PhpStorm: Automatically deploy .css files after File Watcher transpiled .less / .sass files
Asked Answered
B

1

11

I am deploying my documents automatically to the server.

When I save my .less / .sass files, the File Watcher transpiles them, but only uploads the source files, not the transpiled .css file.

Is there a way that the .css file is also being deployed?

Bargello answered 27/5, 2014 at 13:16 Comment(0)
J
23

Make sure to tick the 'Upload external changes' checkbox in Deployment/Options. This option makes PHPStorm upload the files changed by a third-party tool (LESS compiler in your case). See http://www.jetbrains.com/webstorm/webhelp/deployment.html and related topics for more info

Josefinejoseito answered 27/5, 2014 at 14:15 Comment(8)
I never peeked into 'Options' before, thank you for the hint!Moriahmoriarty
Does anyone else have the issue where they have to lose and regain focus of phpStorm for the external changes to be detected by phpstorm, and henceforth uploaded?Round
do you use a file watcher to compile .less? Usually such problems indicate configuration issues: 'output paths to refresh' file watcher option is not set up correctly, so that the generated files don't appear in PHPStorm virtual file system until it's synchronized with external changes (that usually happens when you move focus back to the IDE)Josefinejoseito
And now I understand what that checkbox is for. Thanks!Thread
Caution! This can cause serious problems when you use git! If you change the current branch, all the files that changed will be uploaded because they are "external changes"! So you lose the posibility of switching between live/dev-branches. There must be another way...Crest
I started Using GruntJs recently, and it works fine, but external changes are not uploaded on server (and they are not even seen on the project window untill I refresh the window) Can anybody help me?Odle
just some things to check: do you run Grunt from WebStorm/PHPStorm, using Grunt integration, or externally? Do you have 'Synchronize files on frame or editor tab activation' option enabled? Is your project located on local disk, or on some mounted drive? Do you have any symlinks in the project path?Josefinejoseito
Following the given answer you can additionally add the folder with your less files to the tab "Excluded Paths" in the deployment settings. Thus they won't be uploaded to your live installation if unnecessary.Bloodshed

© 2022 - 2024 — McMap. All rights reserved.