Transparently use webpack with flask
Project description
flask-webpack-loader
flask version django-webpack-loader
Install
npm install --save-dev webpack-bundle-tracker
pip install flask-webpack-loader
Usage
app.py
from flask_webpack_loader import WebpackLoader
webpack_loader = WebpackLoader(app)
template.html
{{ render_bundle('main') | safe }}
# webpack 4+
{{ render_bundle('runtime~main') | safe }}
{{ render_bundle('undefined') | safe }}
Configuration
WEBPACK_LOADER = {
'BUNDLE_DIR_NAME': os.path.join('static', 'bundles'),
'STATIC_URL': 'static',
'STATS_FILE': 'webpack-stats.prod.json',
'POLL_INTERVAL': 0.1,
'TIMEOUT': None,
'IGNORES': [re.compile(r'.+\.hot-update.js'), re.compile(r'.+\.map')]
}
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
Close
Hashes for flask-webpack-loader-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | acce747d864ac35d03f8e6df50ee266b77e18c1cc0617c7a5ad7e96f88f92056 |
|
MD5 | 0a3c0fac65b1c44258739602b569a802 |
|
BLAKE2b-256 | 521370ac01948202432b32361c259ff5f785fe8a0916e40b77d30a4d46e23431 |