matthewmueller / joy

A delightful Go to Javascript compiler (ON HOLD)
https://mat.tm/joy
GNU General Public License v3.0
1.32k stars 35 forks source link

remove packages that just contain files #51

Closed matthewmueller closed 6 years ago

matthewmueller commented 7 years ago

e.g.

var preact = js.RawFile("./preact.js")

// Render the component
func Render(component jsx.Component) {
    js.Rewrite("$1.render($2, document.body)", preact, component)
}

Turns into:

(function() {
    var preact = js.RawFile("./preact.js")
    return {}
})()