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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 427d5b612eb84b4db278927bda6606779eb31c1648d1b0710e58a580179d944c |
|
MD5 | c76bc7286375aed12a1fe8fb92a7d43c |
|
BLAKE2b-256 | 076c35b47d81af84479a992a739ef8a605a8466413ed403c93550fafda35932f |