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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1d6cb86e43a714935c945a5e5bece942efcd877badecc42e7d4003d865943dd |
|
MD5 | b96e1a20e9d1995ad8742a01a472bf04 |
|
BLAKE2b-256 | 3caf5c7160560ec724df7cc98ba0a172421642abec01e4fa64f5603d5d06914a |