Giter Club home page Giter Club logo

flask-webpackext's Introduction

Flask-WebpackExt

image

image

image

image

image

Webpack integration for Flask.

Flask-WebpackExt makes it easy to interface with your existing Webpack project from Flask and does not try to manage Webpack for you. Flask-WebpackExt does this via:

  • Manifests: You tell Webpack to write a manifest.json using plugins such as webpack-manifest-plugin, webpack-yam-plugin or webpack-bundle-tracker. Flask-WebpackExt reads the manifest and makes your compiled assets available in your Jinja templates.
  • CLI for NPM: Flask-WebpackExt provides a Flask CLI so that e.g. flask webpack install will run npm install in your Webpack project. Similarly, flask webpack build will run npm run build.

Optionally you can use Flask-WebpackExt to also:

  • Inject configuration: Flask-WebpackExt will write a config.json into your Webpack project, which you can import in your Webpack configuration. You define what goes in the config e.g. Let Webpack know about output paths or dynamic entry points.
  • Collect bundles: If your Webpack project is spread over multiple Python packages, Flask-WebpackExt can help you dynamically assemble the files into a Webpack project. This is useful if you don't know until runtime which packages are installed.

Further documentation is available on https://flask-webpackext.readthedocs.io/

flask-webpackext's People

Contributors

chiarabi avatar fenekku avatar frankois avatar lnielsen avatar ntarocco avatar topless avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flask-webpackext's Issues

CLI chaining support for install and build

You can already chain e.g. flask webpack create install like this, but you cannot chain other commands after install or build, e.g. you can't flask webpack create install build.

This is because we accept arbitrary options after install which is passed to NPM.

Would be nice if there was a way to allow flask webpack create install build

"Usage" page of documentation is outdated

Describe the bug

When i tried to follow the steps described in the documentation (usage page) i was facing following error while building the assets:

> webpack --config webpack.config.js

[webpack-cli] TypeError: Cannot read property 'length' of undefined
    at /home/fwoerister/PycharmProjects/webpack/instance/assets/node_modules/webpack-manifest-plugin/lib/plugin.js:129:39
    at Array.reduce (<anonymous>)
    at ManifestPlugin.<anonymous> (/home/fwoerister/PycharmProjects/webpack/instance/assets/node_modules/webpack-manifest-plugin/lib/plugin.js:116:26)
    at Hook.eval [as callAsync] (eval at create (/usr/lib/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/usr/lib/node_modules/webpack/node_modules/tapable/lib/Hook.js:18:14)
    at Compiler.emitAssets (/usr/lib/node_modules/webpack/lib/Compiler.js:862:19)
    at /usr/lib/node_modules/webpack/lib/Compiler.js:450:10
    at processTicksAndRejections (internal/process/task_queues.js:77:11)

Steps to Reproduce

Following the steps described on the "usage" page of the documentation.

Expected behavior

The assets should be built without error

Additional context

After some investigation I realized that this error was a known issue, that was fixed in a more recent version of the plugin. I also found out that in the more recent versions the plugin class was renamed from "ManifestPlugin" to "WebpackManifestPlugin" which has to be fixed in the webpack config as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.