Skip to content

Properly stub out methods in minified files #785

Description

@kadamwhite

We attempt to suppress two methods, _friendlyFileLoadError and _validateParameters, when we build the minified file. The manner in which we're stubbing these methods doesn't actually have an effect in some circumstances, specifically when we require P5 via AMD or CommonJS require calls, vs depending on it as a global.

One option is to move these methods to their own module, then have browserify create two builds, one for the unminified source that works as-is and another that stubs out these modules, and only minify the latter build. This way they'll be properly disabled no matter how p5 is called, and may save us a byte or two in the process.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions