aurelia / bundler

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

[Feature Request] Support template together with view model minification #140

Closed bigopon closed 8 years ago

bigopon commented 8 years ago

Hi, as titled, it would be really great if there is a way to minimize the template together with view model properties.

example:

Source:

<!-- section-manager.html -->
<template>
    <require from='./au-section'></require>
    <au-section repeat.for='section of sections' section.bind='section'></au-section>
</template>
// section-manager.js
export class SectionManager {
    @bindable sections;
}

// au-section.js
export class AuSection {
    @bindable section;
}

Expected result:

<!-- section-manager.html -->
<template>
    <require from='./au-section'></require>
    <au-section repeat.for='a of $a' $b.bind='a'></au-section>
</template>
// section-manager.js
export class SectionManager {
    @bindable $a;
}

// au-section.js
export class AuSection {
    @bindable $b;
}
EisenbergEffect commented 8 years ago

This would involve changing the public APIs of classes, which isn't something that you normally do during minification anyway and could break a lot of apps. Feel free to work on this as a gulp or webpack plugin if it interests you. It's not something we are planning to do now or in the relative near future.