Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console spam when parsing inline sourcemaps #288

Open
apellerano-pw opened this issue Jun 18, 2021 · 1 comment
Open

Console spam when parsing inline sourcemaps #288

apellerano-pw opened this issue Jun 18, 2021 · 1 comment

Comments

@apellerano-pw
Copy link

Problem

When this addon encounters an inline sourcemap (sourceMappingURL=data:application/json;charset=utf-8;base64,[giant base64 blob...]), it fails to parse it and generates a huge console message containing the entire base64 blob.

Cause

The source-map-url package used in this lib will return the entire inline sourcemap when you call getFrom(code).

This becomes an issue in get-sourcemap-content.js, because it always assumes getFrom(code) returns a url.

The filesystem exists check fails, and a console.warn message fires off saying the url referenced could not be found. However this url is actually the huge inline sourcemap blob!

@apellerano-pw
Copy link
Author

As a workaround, you could exclude the file with the inline sourcemap from the ember-cli-terser config:

'ember-cli-terser': {
  exclude: [
    'assets/example.js',
  ],
},

According to the ember-cli-terser docs, it's okay to pass broccoli-terser-sourcemap config through it, and this lib supports an exclude globs array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant