Skip to main content

JS minifier for Lektor. Based on rjsmin.

Project description

lektor-JSminify

PyPI version Downloads

JS minifier for Lektor that automatically minifies javascript files

Uses rjsmin and looks for .js files, minifying them as part of the build process. It only rebuilds when it's needed (file changed or the config changed). When starting the the development server it watchs the files for changes in the background and rebuilds them when needed.

Installing

You can install the plugin with Lektor's installer::

lektor plugins add lektor-jsminify

Or by hand, adding the plugin to the packages section in your lektorproject file::

[packages]
lektor-jsminify = 1.4.1

Usage

To enable jsminify, pass the jsminify flag when starting the development server or when running a build:

lektor server -f jsminify
lektor build -f jsminify

When the flag is present, jsminify will take all .js files from asset_sources/js, minifies them and places them in assets/js.

The Plugin has the following settings you can adjust to your needs:

parameter default value description
source_dir asset_sources/js/ the directory in which the plugin searchs for js files (subdirectories are included)
output_dir assets/js/ the directory the minified js files get place at
name_prefix prefix for output name e.g. test.js becomes to test<name_prefix>.js
keep_bang_comments False keep comments starting with an exclamation mark
excluded_assets exclude .js files using a comma separated list of unix shell style wildcards (fnmatch)
included_assets include .js files using a comma separated list of unix shell style wildcards (fnmatch) overrides excluded assets

An example config can be found at configs/jscompile.ini

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for lektor-jsminify, version 1.4.1
Filename, size File type Python version Upload date Hashes
Filename, size lektor_jsminify-1.4.1-py3-none-any.whl (5.0 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size lektor-jsminify-1.4.1.tar.gz (3.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page