![]() Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:ġ. Reporting can be done by sending an email to you report a bug, make sure you give me enough information (include your code).Ĭopyright (c) 2012, Matthias Mullie. If you find any bugs help me out and report them. The class is documented in the file itself. To use it in other projects, select Global from the Level list.This source file can be used to minify Javascript files. Make sure the Enabled checkbox is selected.īy default, the File Watcher will be available in the current project. PhpStorm brings you back to the File Watchers page where the new File Watcher is added to the list: If you installed csso-cli through the Node Package Manager, PhpStorm locates the package itself and fills in the field automatically with the csso alias Otherwise, type the path manually or click and select the file location in the dialog that opens.Īccept the default File Watcher settings or reconfigure them, if necessary, as described in File Watchers, and click OK. In the Program field, specify the location of the csso executable file. The File Watchers page that opens shows the list of already configured File Watchers.Ĭlick or press Alt+Insert and select the CSSO CSS Optimizer predefined template from the list. In the Settings dialog ( Ctrl+Alt+S), click File Watchers under Tools. In the embedded Terminal ( Alt+F12), type: For more information, refer to Managing plugins. Make sure the CSS and File Watchers required plugins are enabled on the Settings | Plugins page, tab Installed. Make sure you have Node.js on your computer. To change this default presentation, configure file nesting in the Project tool window. However, in the Project Tree, the file with the minified code is shown under the source CSS file which is displayed as a node. The location of this generated file is defined in the Output paths to refresh field of the New Watcher dialog. The generated minified code is stored in a separate file with the name of the source CSS file and the extension min.css. You can specify other events that invoke CSSO. To minify your code automatically, you need to install CSSO and configure a CSSO File Watcher which will track changes to your files and run the tool.īy default, minification starts as soon as a CSS file in the File Watcher's scope is changed and saved. You can install another minification tool and configure it following the steps from the example below. The example only illustrates the workflow. ![]() The example below shows how you can use CSSO to minify your CSS code right from PhpStorm. ![]() You can specify other events that invoke the tool. To minify your code automatically, you need to install a minification tool and configure a File Watcher which will track changes to your files and run the minification tool.īy default, minification starts as soon as a CSS file in the File Watcher's scope is changed and saved. ![]() If you're not using build tools, you can use stand-alone tools, such as CSSO or cssnano. Most often compression is done as a step in your build process, with tools like webpack. At the production stage, they only increase the size of code to be transferred. During development and debugging, these characters make code easier to read. Minification or compression means removing all unnecessary characters, such as spaces, new lines, comments, without changing the functionality of the source code. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |