aurelia / new

The Aurelia 2 scaffolding repo used by our tools to setup new projects.
MIT License
35 stars 18 forks source link

Latest Aurelia build breaks browser test with jasmine/mocha + parcel #96

Closed 3cp closed 1 year ago

3cp commented 1 year ago

Note the //# sourceMappingURL=index.mjs.map out of nowhere for some Aurelia exports.

parcelHelpers.export(exports, "observable", ()=>_runtime.observable);
parcelHelpers.export(exports, "subscriberCollection", ()=>_runtime.subscriberCollection);
parcelHelpers.export(exports, "Aurelia", ()=>Aurelia) //# sourceMappingURL=index.mjs.map
;
parcelHelpers.export(exports, "PLATFORM", ()=>l);
parcelHelpers.export(exports, "default", ()=>Aurelia);

For example, here the "aurelia" package. The index.mjs file has //# sourceMappingURL=index.mjs.map at the end, but the file index.mjs.map is missing. I assume we didn't want sourceMap for the production build, so the last line in index.mjs should be removed. @bigopon

I guess the missing map file confused Parcel, so it kept some of the //#... line in the code. I also noted all our au2 packages have this missing map file, but Parcel didn't add the extra //#... line for all of the exports. (Might be just for the first exports from an au2 package).

huocp@Chunpengs-MacBook-Pro ~/p/p/n/a/d/esm> ll
total 24
-rw-r--r--  1 huocp  staff   3.1K 30 Aug 11:15 index.dev.mjs
-rw-r--r--  1 huocp  staff   1.3K 30 Aug 11:15 index.dev.mjs.map
-rw-r--r--  1 huocp  staff   2.7K 30 Aug 11:15 index.mjs

huocp@Chunpengs-MacBook-Pro ~/p/p/n/a/d/esm> pwd
/Users/huocp/playground/p1/node_modules/aurelia/dist/esm

huocp@Chunpengs-MacBook-Pro ~/p/p/n/a/d/esm> tail index.mjs
                host: t,
                component: e
            });
        }
        return super.app(e);
    }
}

export { Aurelia, l as PLATFORM, Aurelia as default };
//# sourceMappingURL=index.mjs.map

I manually removed that line from "aurelia" package's dist/esm/index.mjs and it did let Parcel removing that generated //#... line. Is this something you can cleanup in au2 monorepo? @bigopon

3cp commented 1 year ago

The behaviour might be a combined effect of our setup and latest parcel.

bigopon commented 1 year ago

Thanks @3cp we should be able to remove that line. Or maybe prod sourcemap should be added back.

3cp commented 1 year ago

Bypassed it with proper sourcemap setup for parcel testing build. Previously sourcemap is off for testing build.