Skip to content

Proposal: minify flag automatically adds minify build tag #611

Closed
@myitcv

Description

@myitcv

Headline proposal

When the -m (--minify) flag is provided to those commands that can accept it, add the minify build tag automatically.

Detail

This proposal is principally aimed at the use of .inc.js files.

I'm now bundling the React javascript files with my React bindings via a similar approach to that described by @flimzy

The choice of whether to import a package that includes a minified Javascript file or the full "dev" version is currently based on the debug build flag:

// +build !debug

package bundle

import _ "github.com/myitcv/gopherjs/react/internal/prod"

I'd like to propose that when the -m (--minify) is provided this automatically sets the minify build tag (e.g. gopherjs serve -m would be equivalent in effect to gopherjs serve -m --tags minify). The above approach could then switch to using the inverted minify build flag and the net effect would be exactly as expected.

This will allow bindings developers to unify on a common approach for use of .inc.js files (irrespective of whether #468 is resolved)

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions