Socket
Socket
Sign inDemoInstall

lektor-jsminify

Package Overview
Dependencies
2
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    lektor-jsminify

JS minifier for Lektor. Based on rjsmin.


Maintainers
1

Readme

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:

parameterdefault valuedescription
source_dirasset_sources/js/the directory in which the plugin searchs for js files (subdirectories are included)
output_dirassets/js/the directory the minified js files get place at
name_prefixprefix for output name e.g. test.js becomes to test<name_prefix>.js
keep_bang_commentsFalsekeep comments starting with an exclamation mark
excluded_assetsexclude .js files using a comma separated list of unix shell style wildcards (fnmatch)
included_assetsinclude .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

Keywords

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc