jdiehl / brackets-less-autocompile

Automatic compilation of LESS files for Brackets
93 stars 36 forks source link

Autoprefixer #62

Closed piccaso closed 9 years ago

piccaso commented 9 years ago

Is it possible to use this Extension with less-plugin-autoprefix or any other Autoprefixer?

I tried...

// plugins:[new (require('less-plugin-autoprefix'))({browsers: ["last 2 versions"]})]

but I didn't really expect it to be that easy :)

jdiehl commented 9 years ago

Not yet. Any takers?

piccaso commented 9 years ago

I tried harder, still no joy, just locked up brackets :(

diff --git a/node/LessCompiler.js b/node/LessCompiler.js
index cf88be6..012b88c 100644
--- a/node/LessCompiler.js
+++ b/node/LessCompiler.js
@@ -106,2 +106,3 @@
       // options.rootpath = lessPath;
+      options.plugins = [new (require('less-plugin-autoprefix'))({browsers: ["last 2 versions"]})];

diff --git a/package.json b/package.json
index 6617751..b02557f 100644
--- a/package.json
+++ b/package.json
@@ -22,2 +22,3 @@
   "dependencies": {
+    "less-plugin-autoprefix": "^1.4.0",
     "less-plugin-clean-css": "^1.2.0"

I'd love to take that and implement something like

  // autoprefix:"last 2 versions"

but right now i have no idea how to even hardcode the plugin... and the debugger refuses to be helpfull... Any advice would be highly appreciated :)

jdiehl commented 9 years ago

I have added autoprefixer and cleancss support with the option of setting browser / compatibility via the first line as you suggested.

I am having problems with the brackets registry but as soon as these are resolved I will update the plugin. For now, just check out the master and you should be all set. Thanks for helping out!

piccaso commented 9 years ago

Thank you very much!

btw, just an idea... As a temporary workaround to the registry problem you could tag your Release and upload a zip of your plugin there, so it could be installed using the 'Install from URL' way.