{
"info": {
"author": "Nick Janetakis",
"author_email": "nick.janetakis@gmail.com",
"bugtrack_url": null,
"classifiers": [],
"description": "|PyPI version| |Build status|\n\nWhat is Flask-Webpack?\n^^^^^^^^^^^^^^^^^^^^^^\n\nManaging assets can be a serious burden. Here's just a few things you get by\nusing this package:\n\n- Minify assets\n- Attach vendor prefixes to your CSS automatically\n- Optimize image sizes\n- Leverage the CommonJS module system to organize your Javascript\n- Compile Markdown\n- Compile 20+ client side template languages\n- Compile LESS, SASS and any other CSS pre-processor you can imagine\n- Compile Typescript, Coffeescript and any other *to-javascript* language\n- Compile Ecmascript 6 (ES) down to ES 5\n- Compile React JSX to JS with hot module reloading\n- Near instant compile times, ~20-50ms is common on my workstation\n- Optionally get source maps in development mode\n- Serve your assets from a tricked out local development asset server\n- Cache all assets forever because their file names get md5-tagged\n- The only runtime you need other than Python is NodeJS\n- Never deal with file watchers again because it's all taken care of for you\n- And much more...\n\nAll of the features above are the direct result of using `Webpack `_\nto manage your assets. The huge win here besides the obvious is that the\nfunctionality is outside of this package.\n\nThat means you have free reign to pick and choose what you want without\nhaving to worry about Flask-Webpack versions. If a new Webpack plugin becomes\navailable, you can use it immediately.\n\nWhat does this package do then?\n-------------------------------\n\nIt sets up a few template tags so you can access the assets inside of your\njinja templates.\n\n**It means you can type this:**\n\n``
``\n\n**...and once your jinja template has been compiled, you will see this:**\n\n``
``\n\nNow you can happily tell your frontend proxy to cache that hamburger image for\nan entire year. If you ever change the hamburger, the md5 will change but you\ndo not need to change any of your templates because the ``asset_url_for``\ntag knows how to look it up.\n\nGlobal template tags\n--------------------\n\n- **asset_url_for(asset_relative_path)** to resolve an asset name\n- **javascript_tag(\\*asset_relative_paths)** to write out 1 or more script tags\n- **stylesheet_tag(\\*asset_relative_paths)** to write out 1 or more stylesheet tags\n\nBoth the javascript and stylesheet tags accept multiple arguments. If you give\nit more than argument it will create as many tags as needed.\n\n\nInstallation\n^^^^^^^^^^^^\n\n``pip install Flask-Webpack``\n\nQuick start\n^^^^^^^^^^^\n\n::\n\n from flask import Flask\n from flask_webpack import Webpack\n\n webpack = Webpack()\n\n app = Flask(__name__)\n webpack.init_app(app)\n\nYou can view a complete working example in the `test app `_.\n\nThere's also a `blog post and short video `_ explaining how to use this extension.\n\nHow does it work?\n-----------------\n\nIt expects you to have built a manifest file and it handles the rest. You can\nbuild this manifest file using a plugin I wrote for Webpack. You can find that\nplugin `here `_.\n\nThis process is done automatically upon starting the dev asset server or building\nyour assets to prepare for a production release. All of that is taken care of in\nthe ``webpack.config.js`` file.\n\nSettings\n^^^^^^^^\n\n``Flask-Webpack`` is configured like most Flask extensions. Here's the available\noptions:\n\n- ``WEBPACK_MANIFEST_PATH``: default ``None``\n - **Required:** You may consider using ``./build/manifest.json``, it's up to you.\n\n- ``WEBPACK_ASSETS_URL``: default ``publicPath from the webpack.config.js file``\n - **Optional:** Use this asset url instead of the ``publicPath``.\n - You would set this to your full domain name or CDN in production.\n\nLearn more\n^^^^^^^^^^\n\nWebpack knowledge\n-----------------\n\nMost of what you'll need to learn is related to Webpack specifically but the\nexample app in this repo is enough to get you started. Here's a few resources\nto help you get started with Webpack:\n\n- `What is Webpack? `_\n- `Getting started `_\n- `List of loaders `_\n- `Advanced setup with React `_\n\nHelp! My assets do not work outside of development\n--------------------------------------------------\n\nI see, so basically the problem is you're using the ``url()`` function in your\nstylesheets and are referencing a relative path to an asset, such as:\n\n``src: url('../../fonts/CoolFont.eot')``\n\nThe above works in development mode because that's where the file is \nlocated but in production mode the asset is not there. The ``asset_url_for`` \ntemplate helper handles all of this for you on the server side but now you need\nsome assistance on the client side as well.\n\nYou have a few options here depending on if you're using CSS, SASS or something\nelse. If you're using straight CSS you will need to pre-prend all of your paths\nwith a special identifier.\n\nIf you were to re-write the example from above, it would now be:\n\n``src: url('~!file!../../fonts/CoolFont.eot')``\n\nThat will automatically get expanded to a path that works in every environment.\n\nIf you're using SASS you can create your own function to make things easier to\nwork with on a day to day basis. Something like this should suffice:\n\n::\n\n @function asset-url($path) {\n @return url('~!file!' + $path);\n }\n\nNow you can call it like this and everything will work:\n\n``src: asset-url('../../fonts/CoolFont.eot')``\n\nFeel free to make additional helper functions that let you abstract away the\nrelative prefix such as ``font-url`` or ``image-url``. It really depends on how\nyour assets are set up.\n\nContributors\n^^^^^^^^^^^^\n\n- Nick Janetakis \n\n.. |PyPI version| image:: https://badge.fury.io/py/flask-webpack.png\n :target: https://pypi.python.org/pypi/flask-webpack\n.. |Build status| image:: https://secure.travis-ci.org/nickjj/flask-webpack.png\n :target: https://travis-ci.org/nickjj/flask-webpack\n",
"description_content_type": null,
"docs_url": null,
"download_url": "UNKNOWN",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/nickjj/flask-webpack",
"keywords": null,
"license": "GPLv3",
"maintainer": null,
"maintainer_email": null,
"name": "Flask-Webpack",
"package_url": "https://pypi.org/project/Flask-Webpack/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/Flask-Webpack/",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "https://github.com/nickjj/flask-webpack"
},
"release_url": "https://pypi.org/project/Flask-Webpack/0.1.0/",
"requires_dist": null,
"requires_python": null,
"summary": "Flask extension for managing assets with Webpack.",
"version": "0.1.0"
},
"last_serial": 1932561,
"releases": {
"0.0.1": [
{
"comment_text": "",
"digests": {
"md5": "ac846661bfef34c20c24096190a9c0aa",
"sha256": "8e7b1311181da87950a7a9b90886730ca9c5deefa38cfd131a2334333d1e0597"
},
"downloads": -1,
"filename": "Flask-Webpack-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "ac846661bfef34c20c24096190a9c0aa",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 15151,
"upload_time": "2015-06-03T15:43:27",
"url": "https://files.pythonhosted.org/packages/14/dd/3aef369bccc08432f0a8bbde29cf8c53aed6ce5618bf337f0aaa6bb24056/Flask-Webpack-0.0.1.tar.gz"
}
],
"0.0.2": [
{
"comment_text": "",
"digests": {
"md5": "fa48c00acfe66f8148016b21bf8365fe",
"sha256": "6f59d681e57774ca7b4aec54c85fb4fa7708742e6b282bb00c7cb7751ca3879f"
},
"downloads": -1,
"filename": "Flask-Webpack-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "fa48c00acfe66f8148016b21bf8365fe",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 16471,
"upload_time": "2015-06-03T16:16:56",
"url": "https://files.pythonhosted.org/packages/73/a2/505609bd4d2f0dea91f48ec440cc9cd5f17022aaafed8fb85e8a6620717e/Flask-Webpack-0.0.2.tar.gz"
}
],
"0.0.3": [
{
"comment_text": "",
"digests": {
"md5": "8d6f0d46af5482bc80138bc807586ec6",
"sha256": "1ddf1feea74c1cd7fa0df9b35c024eaedba10c147e05d5e1f479e39ae5fadc88"
},
"downloads": -1,
"filename": "Flask-Webpack-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "8d6f0d46af5482bc80138bc807586ec6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 16755,
"upload_time": "2015-06-04T17:51:54",
"url": "https://files.pythonhosted.org/packages/e4/54/6f15e43095aa76afa8db0a22496e5e5ef201919e7da32849381faf785934/Flask-Webpack-0.0.3.tar.gz"
}
],
"0.0.5": [
{
"comment_text": "",
"digests": {
"md5": "4566f8a445dc17d5f130d731786e9ee5",
"sha256": "e6393b153d63982fafd20a3d95982a04411376d3eebcfa97987f4132b8c4b5b2"
},
"downloads": -1,
"filename": "Flask-Webpack-0.0.5.tar.gz",
"has_sig": false,
"md5_digest": "4566f8a445dc17d5f130d731786e9ee5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 17360,
"upload_time": "2015-06-19T21:34:22",
"url": "https://files.pythonhosted.org/packages/64/cd/5b9b6c81af347d8fc726c716514324162f8ddb5d6fbaf3edc2f7d1444678/Flask-Webpack-0.0.5.tar.gz"
}
],
"0.0.6": [
{
"comment_text": "",
"digests": {
"md5": "0fc8b456dbb465e8b17b4bac64cf0f69",
"sha256": "df4b8c6958308c565ea480083a56c24fd2970221931fe48cfc03f8bc1feb1aad"
},
"downloads": -1,
"filename": "Flask-Webpack-0.0.6.tar.gz",
"has_sig": false,
"md5_digest": "0fc8b456dbb465e8b17b4bac64cf0f69",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 17352,
"upload_time": "2015-06-26T11:55:42",
"url": "https://files.pythonhosted.org/packages/97/06/db894256662a2e0aeecb5a81af9ad691c3075dafc0054fe191ace79d4b2f/Flask-Webpack-0.0.6.tar.gz"
}
],
"0.0.7": [
{
"comment_text": "",
"digests": {
"md5": "c162e6327689800ac72799128ce31d47",
"sha256": "d58567999d136d12ac14ad4860afcdc7d859661051cd66af849871e651a85645"
},
"downloads": -1,
"filename": "Flask-Webpack-0.0.7.tar.gz",
"has_sig": false,
"md5_digest": "c162e6327689800ac72799128ce31d47",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 17368,
"upload_time": "2015-08-15T17:45:27",
"url": "https://files.pythonhosted.org/packages/c5/be/9201316f4e9265d6bfb71886b541fd0accc940308a6de3b9b5d80164793c/Flask-Webpack-0.0.7.tar.gz"
}
],
"0.1.0": [
{
"comment_text": "",
"digests": {
"md5": "9f49c656b3277e2cd22ae78c4f9dfd3e",
"sha256": "aa56bf97253a07e09514e2ff6ff67497d8654a66a17c208394687a64528ddc74"
},
"downloads": -1,
"filename": "Flask-Webpack-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "9f49c656b3277e2cd22ae78c4f9dfd3e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 17200,
"upload_time": "2016-01-31T21:56:24",
"url": "https://files.pythonhosted.org/packages/8a/20/d65d148939e75f860b059f3d960ccdd316da599a9ee54462d9b53821d16c/Flask-Webpack-0.1.0.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "9f49c656b3277e2cd22ae78c4f9dfd3e",
"sha256": "aa56bf97253a07e09514e2ff6ff67497d8654a66a17c208394687a64528ddc74"
},
"downloads": -1,
"filename": "Flask-Webpack-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "9f49c656b3277e2cd22ae78c4f9dfd3e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 17200,
"upload_time": "2016-01-31T21:56:24",
"url": "https://files.pythonhosted.org/packages/8a/20/d65d148939e75f860b059f3d960ccdd316da599a9ee54462d9b53821d16c/Flask-Webpack-0.1.0.tar.gz"
}
]
}