Skip to content

Webworkify + Uglify-js + Require.js not getting along  #29

@etpinard

Description

@etpinard

Hi, I'm trying to load up a browserify --standalone bundle that includes webworkify that been minified with uglifyjs using the --mangle and --compress options in Require.js.

Problem

Require.js fails to load the bundle:

image

Reproducible example

See https://gist.github.com/etpinard/8ec2c29210d5adee049d54bb427bbbe6

Observations

This line seems to be causing the issue when compressed by uglifyjs

Replacing

'var f = require(' + stringify(wkey) + ');' +
'(f.default ? f.default : f)(self);'

by

'var f = require('+stringify(wkey)+');' +
'(f.default ? f.default : f)(self);'

and running browserify and uglifyjs without the --compress option is enough to replicate the problem listed above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions