armin-pfaeffle / atom-minify

Minifies JS and CSS files, optionally on save ‒ package for atom.io
https://atom.io/packages/atom-minify
MIT License
24 stars 7 forks source link

Filename pattern is not working #42

Open madsem opened 7 years ago

madsem commented 7 years ago

I have tried several different settings, none did anything. Minified files are always saved to the directory the original file resides in.

For example:

../$1.min.$2

Expected result: file will be saved one dir up from the dir where the current file sits result: File is saved in the same dir where current file resides.

Same result with any other setting I've tried:

../css/min/$1.min.$2
absolute/path/from/project/root/css/min/$1.min.$2
armin-pfaeffle commented 7 years ago

Did you set this in the settings? Or do you use a first-line-comment? If yes, can you paste it here?

madsem commented 7 years ago

I've set it in the settings exactly as above. Is there another way to achieve this?

Sent from my iPhone

On Jan 26, 2017, at 10:32 PM, Armin Pfäffle notifications@github.com wrote:

Did you set this in the settings? Or do you use a first-line-comment? If yes, can you paste it here?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

armin-pfaeffle commented 7 years ago

Yep! You could try to add this comment in the first line of your file:

/* filenamePattern: ../$1.compressed.$2 */

I will check your bug report!

madsem commented 7 years ago

awesome, thank you. Will let you know tomorrow if the comment worked

madsem commented 7 years ago

The filepattern comment works like a charm Armin, granted it's not as comfy as having it in the settings and forget about it, but will do the trick for the time being :)

armin-pfaeffle commented 7 years ago

Hm... I tried relative and absolute paths. Everythings works fine here, with every minifier.

Which version of atom-minify do you use? Which minifier? Mac? Win? Linux?

Sineos commented 6 years ago

Having a similar issue:

OS: Win 10 Minifier: 0.8.0

// minifier: gcc, buffer: 8388608, minifierOptions: "compilation_level=SIMPLE_OPTIMIZATIONS externs=D:\21_Git\MD\_tools\lin\FileSaver.min.ext.js externs=D:\21_Git\MD\_tools\lin\jquery.ext.js"

works, where as

// minifier: gcc, buffer: 8388608, minifierOptions: "compilation_level=SIMPLE_OPTIMIZATIONS externs=./FileSaver.min.ext.js externs=./jquery.ext.js"

will throw an error.