aurelia / bundler

A library for bundling JavaScript, HTML and CSS for use with SystemJS.
MIT License
37 stars 25 forks source link

Revision missing on html import template bundle #143

Closed fragsalat closed 7 years ago

fragsalat commented 8 years ago

I'm submitting a bug report

Please tell us about your environment:

Current behavior: A html bundle using the config property htmlimport: true and the option rev: true doesn't append a revision number to the file name. See config below.

Expected/desired behavior: The filename of the bundled html templates contains a generated revision number.

Here's my example config:

'view-bundle': {
    'htmlimport': true,
    'includes': [
        'app/**/*.html',
        'some-jspm-package/some-webcomponent-which-is-by-the-way-not-included-in-the-bundle-for-any-reason.html'
    ],
    'options': {
        'inject': true,
        'minify': true,
        'rev': true
    }
}

To fix that problem the utility function getOutFileName(content: Sting, fileName: String, revision: Boolean) should be used to get the filename for the bundle. Also the check if the bundle exists already should be done after bundling because the content is required to generate the hash and the hash is required to generate the filename and the filename is required to check if the file exists obviously^^

EisenbergEffect commented 7 years ago

@ahmedshuhel Please review this bug and the associated PR to see if we can get a fix released.

ahmedshuhel commented 7 years ago

On it

ahmedshuhel commented 7 years ago

We will have this feature in the next release.