Skip to main content

IIFE filter for webassets

Project description

Pypi package

webassets-iife is a webassets filter to wrap a JavaScript bundle in an IIFE to prevent global leaks and improve minification.

Install

pip install webassets-iife

Usage

For example with Flask:

from flask.ext.assets import Environment, Bundle
from webassets_iife import IIFE

# ...

assets = Environment(app)

js = Bundle('myscript1.js',
            'myscript2.js',
            filters=(IIFE, 'closure_js'), output='all.min.js')
assets.register('js_all', js)

Project details


Download files

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

Source Distribution

webassets-iife-0.0.2.tar.gz (2.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page