baler icon indicating copy to clipboard operation
baler copied to clipboard

Add new line after sourceMapingUrl

Open boldhedgehog opened this issue 5 years ago • 2 comments

New line is missing after sourceMappingURL hint causing next merged file be on the same line as the comment:

// some code
gento_Theme/js/theme"]})}(require);
//# sourceMappingURL=requirejs-bundle-config.js.map;try { <==== this is a problem
    if (!window.localStorage || !window.sessionStorage) {
        throw new Error();
    }

    localStorage.setItem('storage_test', 1);
    localStorage.removeItem('storage_test');

Steps to reproduce:

  • Install Baler, Magento Baler module;
  • Fulfil Baler requirements: JS bundling, minification are disabled;
  • Generate static and Baler bundles;
  • Generated requirejs-bundle-config.js and balerbundles/core-bundle.js have no new line in the end
  • Merged JS files are invalid.

core-bundle (copy).zip requirejs-bundle-config.zip

boldhedgehog avatar Feb 05 '20 13:02 boldhedgehog

Thanks for the report @boldhedgehog!

To make sure I understand, are you concatenating both requirejs-bundle-config.js and balerbundles/core-bundle.js together yourself?

DrewML avatar Feb 05 '20 18:02 DrewML

@DrewML no, this is the standard Magento JS merging (not bundling). I don't know if you have control over this, but I think you can just disable this hint, it is not valid for when the files are merged anyways.

boldhedgehog avatar Feb 06 '20 01:02 boldhedgehog