ember-cli / broccoli-terser-sourcemap

Broccoli filter to uglify with sourcemaps
MIT License
10 stars 35 forks source link

"<URL> referenced in <RELATIVE_PATH> could not be found error" upgrading to v4 #301

Closed rreckonerr closed 2 years ago

rreckonerr commented 2 years ago

Hi! I recently upgraded from ember-cli-uglify@3 to ember-cli-terser@4 and now I'm seeing an error related to sourcemap URL's when generating production build with sourcemaps enabled. This results in sourcemaps referenced as to a relative path //# sourceMappingURL=app-872148ced72309772aa624ced3dfb68b.map instead of absolute //# sourceMappingURL=https://s3-eu-central-1.amazonaws.com/blabla/assets/app-872148ced72309772aa624ced3dfb68b.map.

No additional ember-cli-terser configuration is set and exactly the same configuration used to work in ember-cli-uglify. Seems like wrong hash is being applied to .map files.

Console output

[TerserWriter][WARN] (broccoli-terser-sourcemap) "https://s3-eu-central-1.amazonaws.com/blabla/assets/app-a7d016737320d4b33763a690926b622f.map" referenced in "assets/app-872148ced72309772aa624ced3dfb68b.js" could not be found
[WARN] (broccoli-terser-sourcemap) "https://s3-eu-central-1.amazonaws.com/blabla/assets/vendor-859e1305b1dc366a97b803eec97b4df5.map" referenced in "assets/vendor-b3eeea38d69cb5b99f35ff8805ab60a3.js" could not be found

Configuration

    fingerprint: {
      enabled: true,
      extensions: [
        "pdf",
        "js",
        "css",
        "png",
        "jpg",
        "gif",
        "map",
        "otf",
        "eot",
        "svg",
        "ttf",
        "woff",
        "woff2",
      ],
      prepend: "https://s3-eu-central-1.amazonaws.com/blabla/",
    },

    sourcemaps: {
      enabled: true,
      extensions: ["js"],
    },

Dist folder contents

rreckonerr commented 2 years ago

Closing this issue as one related only to ember-cli-terser package 😅