Meteor: precompiled scripts run twice if watcher is included

I'm building a meteor project & using stylus to write the css. I like comparing the stylus file to the actual css; however, meteor grabs both files so I end up with double code, which is slowing things down. Since webstorm already compiled the .styl into .css, can I tell meteor to ignore the .styl file? Alternatively, can I have webstorrm save the .css to a hidden folder? (in meteor, hidden folders are prefixed with a ".").

Cheers,
Matt

3 comments
Comment actions Permalink

Not sure why you need a file watcher if the compilation is also done by Meteor.
Anyway, you can configure a file watcher (actually, the stylus transpiler) to place generated files anywhere you like. Just change the 'Arguments' and 'Output paths to refresh' accordingly. For example, the settings below allow placing generated CSS in <project root>/css folder:

Arguments: -c -o $ProjectFileDir$/css/ $FileName$
Working directory: $FileDir$
Output paths to refresh: $ProjectFileDir$/css/$FileNameWithoutExtension$.css

0
Comment actions Permalink

Hi Elena, thanks for your quick response.
Unfortunately, doing what you suggested doesn't work.
First, if I change the file location, the .css file is minified. Since my goal is to compare the .styl to the .css, this doesn't provide any value.
Second, if I route the .css to a folder with a "." prefix, nothing is created. To my knowledge, this is the only way to make meteor ignore a certain file.

Any other suggestions?

0
Comment actions Permalink
First, if I change the file location, the .css file is minified. Since my goal is to compare the .styl to the .css, this doesn't provide any value.



it's not because of changing the location:) It's a '-c' option in my example that makes stylus compiler to compress the output. If you don't need it being complessed, just remove this option:) Honestly, I'd suggest looking at stylus compiler docs to get a notion of it CLI option

Second, if I route the .css to a folder with a "." prefix, nothing is created. To my knowledge, this is the only way to make meteor ignore a certain file.



works for me. What settings did you try? Are there any errors being displayed when you the watcher is triggered?

0

Please sign in to leave a comment.