Skip to main content

Resource Compression

In the source code of the Redefine theme, resource files such as HTML, CSS, JavaScript, and images are not packaged and compressed. The same goes for most Hexo themes. Fortunately, there are plug-ins that can be found to solve this problem.

Here you can use the hexo-all-minifier plug-in, which integrates html-minifier, clean-css, uglify and imagemin , just install and simple configuration to use.

  1. Install hexo-all-minifier in the root directory of the Hexo project.

    $ npm install hexo-all-minifier
  2. In the Hexo configuration file _config.yml, add the following configuration items:

    all_minifier: true

    If you encounter problems when using the plugin or want to make more detailed settings, please check the documentation of the plugin.