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

Broken @import declaration? #43

Open jovilog opened 7 years ago

jovilog commented 7 years ago

By default (clean-css, no additional options), using @import in a CSS file should import the specified file into the minified file, right?

As soon as I use @import in a file, minification fails, stating

Broken @import declaration of "..."

I even tried with an otherwise empty file that has only one @import. Excuse me, but what am I missing?

armin-pfaeffle commented 7 years ago

Hey! I could not reproduce that problem with clean-css 3.3.5. Can you check which version you have installed? On Windows go to this path C:\Users\<username>\.atom\packages\atom-minify\node_modules\clean-css and open package.json. There is a version attribute at the end of the file.

using @import in a CSS file should import the specified file into the minified file, right?

No! This depends on the minifier itself and its options. But my package does not do that automatically.

jovilog commented 7 years ago

I already reinstalled atom-minify, the clean-css version is 3.4.25.

No! This depends on the minifier itself and its options. But my package does not do that automatically.

Ok, all other minifiers do the minification and leave the @import rule untouched. At least, this is the way clean-css should do it as well, isn't it?

Putting processImport = true in the package settings of atom-minify changes nothing. Always the same error.

I'm stuck. What else could I try?

jovilog commented 7 years ago

Exact same problem on OS X, too.

jovilog commented 7 years ago

I tried this on several computers now, to no avail. I cannot minify a file with a relative @import rule with the clean-css minifier. I tried several settings, to no avail. It minifies fine as long as there's no @import rule. What am I missing here?

jovilog commented 7 years ago

@armin-pfaeffle this seems to be about relative @imports. Could you please have a look at the issue I opened in the clean-css repo?

armin-pfaeffle commented 7 years ago

Sorry, that my answer is so late. I was really busy last weeks.

As you already postet here, it's not a problem of my package. I'm sorry, that I can't help you with that. The opened issue has not been fixed right now. I leave this one opened, so I can have a look at it later.

armin-pfaeffle commented 7 years ago

I think there are good news... I can fix that! Wait some days, then I will publish a bigger update.

jovilog commented 7 years ago

Any news regarding this issue?