Bundles multiple css/js files into one and reduce request time
Project description
JS/CSS Bundle
Bundles multiple css or js files into one to reduce worker load for development server (flask) or webserver (nginx) connections
Usage
from flask import Flask
from static_bundle import register_extension
app = Flask(__name__, static_folder='static')
register_extension(app)
{% bundler 'cache/vendor.css' %}
<link rel="stylesheet" type="text/css"
href="{{ file_path_for('static', filename = 'fontawesome-free-5.7.1-web/css/fontawesome.min.css') }}">
<link rel="stylesheet" type="text/css"
href="{{ file_path_for('static', filename = 'css/bootstrap_table_1.18.3/bootstrap-table.css') }}">
<link rel="stylesheet" type="text/css"
href="{{ file_path_for('static', filename = 'css/bootstrap_table_1.18.3/extensions/filter-control/bootstrap-table-filter-control.css') }}">
<link rel="stylesheet" type="text/css" href="{{ file_path_for('static', filename = 'css/datetime_picker_css.css') }}">
{% endbundler %}
This will generate cache/vendor.css
inside static folder and generate final output like below
<link rel="stylesheet" type="text/css" href="/static/cache/vendor.css">
Please create github issue if you encounter any problem.
Checklist Items for future
- Add support for Django & FastAPI
- Add support to minify content
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
static-bundler-0.0.2.tar.gz
(5.2 kB
view details)
Built Distribution
File details
Details for the file static-bundler-0.0.2.tar.gz
.
File metadata
- Download URL: static-bundler-0.0.2.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e54abda89b135d14aee29d67e14a537a444913fd3075f7abc16e71e01bdb587a |
|
MD5 | a491bc625ced25535469c7af1faa94eb |
|
BLAKE2b-256 | 508b7ef4398444c6cf94c7490246887e687d2433ecd73382b9a21ecdddcd4d83 |
File details
Details for the file static_bundler-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: static_bundler-0.0.2-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cf860bb7a8ac599d387b54e09726fb18929762721c52049ef9d7be841a4573c |
|
MD5 | 79cb1f7ba3d9ba37e7de6a661e0212ab |
|
BLAKE2b-256 | 2f8b2ad1346467e9da53500b53c31df1a0d8847ad2ae65cc4f4c3d06d00d2859 |