PHPStorm won't let me use arguments
My file watcher setup | Output from file watcher:
C:/Users/Pwnjo/AppData/Roaming/npm/stylus.cmd style.styl --output ..\css\ --compress
C:\Users\Pwnjo\AppData\Roaming\npm\node_modules\stylus\bin\stylus:641
if (err) throw err;
^
Error: ENOENT: no such file or directory, stat 'C:\Users\Pwnjo\PhpstormProjects\battre\assets\stylus\--output'
Process finished with exit code 1
As you can see, file watcher or stylus won't let me use arguments. It just thinks the entire thing is a file name or something?
I've tried setting it up backwards (commands then file name), or using the arrow setup (--compress < some.styl > some.css), and several other configurations, but everything errors out.
Without any arguments it compiles the stylus into css just fine, but only in the same directory as the stylus.
I just want compressed stylus to go to ../css/<filename>.css (relative to stylus file).
Please sign in to leave a comment.
sorry, but where does the --output option come from? Here is the full list of stylus options (you can run stylus --help to see this list):
Usage: stylus [options] [command] [< in [> out]]
[file|dir ...]
Commands:
help [<type>:]<prop> Opens help info at MDN for <prop> in
your default browser. Optionally
searches other resources of <type>:
safari opera w3c ms caniuse quirksmode
Options:
-i, --interactive Start interactive REPL
-u, --use <path> Utilize the Stylus plugin at <path>
-U, --inline Utilize image inlining via data URI support
-w, --watch Watch file(s) for changes and re-compile
-o, --out <dir> Output to <dir> when passing files
-C, --css <src> [dest] Convert CSS input to Stylus
-I, --include <path> Add <path> to lookup paths
-c, --compress Compress CSS output
-d, --compare Display input along with output
-f, --firebug Emits debug infos in the generated CSS that
can be used by the FireStylus Firebug plugin
-l, --line-numbers Emits comments in the generated CSS
indicating the corresponding Stylus line
-m, --sourcemap Generates a sourcemap in sourcemaps v3 format
--sourcemap-inline Inlines sourcemap with full source text in base64 format
--sourcemap-root <url> "sourceRoot" property of the generated sourcemap
--sourcemap-base <path> Base <path> from which sourcemap and all sources are relative
-P, --prefix [prefix] prefix all css classes
-p, --print Print out the compiled CSS
--import <file> Import stylus <file>
--include-css Include regular CSS on @import
-D, --deps Display dependencies of the compiled file
--disable-cache Disable caching
--hoist-atrules Move @import and @charset to the top
-r, --resolve-url Resolve relative urls inside imports
--resolve-url-nocheck Like --resolve-url but without file existence check
-V, --version Display the version of Stylus
-h, --help Display help information
So, the right command would be
Like:
Note that Stylus compiler can't create folders, so you have to create the out dir (css) yourself prior to running the watcher
Alright, thank you for the help.
---
Upon trying this, nothing worked, including in command-line, so I guess I broke Stylus at some point. I installed Stylus globally through the settings>language and frameworks>node.js page, and then set up my file watcher like so:
As for whatever reason it didn't care for either syntax you supplied, but this finally worked for me.