Skip to content

An proposal for a better webpack_static #330

Closed
@culshaw

Description

@culshaw

It would be really helpful if webpack_static had a twin which had the ability to take a static file then perform the same magic that happens by default with render_bundle.

For example:

{% render_bundle "js/myBundle.js %}

outputs

<script src="https://localhost.dev/static/myBundle.22e6caaab91a7c8e5758.js" integrity="sha256-dwhlwjqtPE+IiaX9FOmAAaMA0d+CqSq2kiQ7OcFm1aM=" ></script>

but an "unbundled" static file

{% webpack_static "js/myAsset.js" %}

outputs

/static/myAsset.js

Could there be a middle ground called asset_bundle where running

{% asset_bundle "js/myAsset.js" %}

would output

<script src="https://localhost.dev/static/myAsset.22e6caaab91a7c8e5758.js" integrity="sha256-dwhlwjqtPE+IiaX9FOmAAaMA0d+CqSq2kiQ7OcFm1aM=" ></script>

Pretty please 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions