skatejs / web-components

[DEPRECATED] - The frictionless way to use the webcomponents/webcomponentsjs polyfills.
MIT License
17 stars 4 forks source link

Errors in FF and Safari using UglifyJS #21

Closed alexreardon closed 7 years ago

alexreardon commented 7 years ago

When running skate-web-components through UglifyJS I am getting a run time exception in firefox and safari.

It seems like it is erroring out in the following dependency: https://github.com/Benvie/WeakMap

alexreardon commented 7 years ago

It looks like this is related to #18

alexreardon commented 7 years ago

We are using the standard webpack uglifyJS plugin:

plugins: [
  new webpack.optimize.UglifyJsPlugin({
        compress: {
            warnings: false,
        },
        output: {
            comments: true,
        },
    }),
]
adevnadia commented 7 years ago

You can temporarily fix it by setting mangle: false, compress: false in this plugin.

treshugart commented 7 years ago

Spoke to @alexreardon IRL and they are using latest, but this is still an issue.

jpnelson commented 7 years ago

The problem is in weakmap – it uses Function.prototype.name

You can workaround it now by putting:

mangle: {
    keep_fnames: true,
}

in your config, but we'll release a new version with a better weakmap dependency.

alexreardon commented 7 years ago

Is this all good now josh?

jpnelson commented 7 years ago

Yes, should be! If it's not let me know.