ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Combiner

:dart: Combine and minify a list of local or remote CSS and/or Javascript files into a single one with Sublime Text

Details

Installs

  • Total 888
  • Win 566
  • Mac 264
  • Linux 58
Jan 22 Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10 Jan 9 Jan 8 Jan 7 Jan 6 Jan 5 Jan 4 Jan 3 Jan 2 Jan 1 Dec 31 Dec 30 Dec 29 Dec 28 Dec 27 Dec 26 Dec 25 Dec 24 Dec 23 Dec 22 Dec 21 Dec 20 Dec 19 Dec 18 Dec 17 Dec 16 Dec 15 Dec 14 Dec 13 Dec 12 Dec 11 Dec 10 Dec 9
Windows 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 2 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

Combiner

Combine a list of local or remote CSS and/or Javascript files into a single one with Sublime Text. Now, it can also minify CSS, Javascript and/or HTML files using online minifiers.

How to use

Just place the following combiner declaration in any file:

/*
Combiner:{
  combine:"/path/to/file1.css",
  combine:"/path/to/file2.css",
  combine:"/path/to/file3.css",
  output:"/path/to/output.file.css"
}
*/

Also you can include multiple Combiner declaration in the same file:

<head>
    ...


    <link rel="stylesheet" href="css/style.css">
    ...
  </head>
  <body>
    <h1>Hello, world!</h1>
    ...


    <script src=js/scripts.js"></script>
  </body>

Or you can create an individual file (txt, json, cfg…) just for Combiner declarations:

{
  "Combiner_CSS":{
    combine:"/path/to/file1.css",
    combine:"/path/to/file2.css",
    combine:"/path/to/file3.css",
    output:"/path/to/output.file.css"
  },

  "Combiner_JS":{
    combine:"/path/to/file1.js",
    combine:"/path/to/file2.js",
    combine:"/path/to/file3.js",
    output:"/path/to/output.file.js"
  },

  "Combiner_LIB":{
    combine:"/path/to/file1.js",
    combine:"/path/to/file2.js",
    combine:"/path/to/file3.js",
    output:"/path/to/output.file.js"
  }
}

Everytime you want to combine files you can use the Context Menu inside the Sublime Text editor window, access the Combiner command under Tools menu in Sublime Text or use the keyboard shortcut: ctrl (super in MacOs X) + alt + c

Remote Files

You can get remote files and combine then in just one local file, only restriction is you have to declare in the same block the same type of files (remote or local)

{ 
  "Combiner_CSS_CDN":{
    combine:"https://remote/path/to/file1.css",
    combine:"https://remote/path/to/file2.css",
    combine:"https://remote/path/to/file3.css",
    output:"/local/path/to/output.file.css"
  },

  "Combiner_CSS":{
    combine:"/path/to/file1.css",
    combine:"/path/to/file2.css",
    combine:"/path/to/file3.css",
    output:"/path/to/output.file.css"
  },

  "Combiner_JS_LIBS":{
    combine:"https://remote/path/to/file1.js",
    combine:"https://remote/path/to/file1.js",
    combine:"https://remote/path/to/file1.js",
    output:"/local/path/to/output.file.js"
  },

  "Combiner_JS":{
    combine:"/path/to/file1.js",
    combine:"/path/to/file2.js",
    combine:"/path/to/file3.js",
    output:"/path/to/output.file.js"
  }
}

Or even you can use it just to download only a single remote file

{ 
  "Combiner_CSS":{
    combine:"https://remote/path/to/file1.css",
    output:"/local/path/to/output.file.css"
  },

  "Combiner_JS_LIBS":{
    combine:"https://remote/path/to/file1.js",
    output:"/local/path/to/output.file.js"
  }
}

Minimize

Also, you can minimize the combined file (or the files you want) using online minifiers created by @andychilton. You just need to use the Context Menu inside the Sublime Text editor window, access the Combiner command under Tools menu in Sublime Text or use the keyboard shortcut: ctrl (super in MacOs X) + alt + m. A new file will be created in the same location of the open one, with the same name adding suffix min. You need internet connection to use minification features.



Installation

Open the Command Palette and select “Package Control: Install Package”. Search for “Combiner”.