You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I first posted this issue in Ember-Cli because I didn't know where to open this issue but after a discussion on Slack I think it better fits here. I just copy and paste it, the original issue is here (ember-cli/ember-cli#7466).
When I build an Ember app with the production flag then the broccoli-asset-rewrite does a wrong rewrite of my assets. In my case this happens when broccoli-asset-rewrite rewrites the path to files which are generated by emscripten.
In my public folder there is another folder which is called assets and there is a folder emscripten. The build result of the emscripten is file called emscripten.js and a emscripten.js.mem file. In the emscripten.js file the path to the .mem file is specified like this: var data = {memoryInitializer: 'assets/emscripten/emscripten.js.mem'};. After fingerprinting the path is rewritten to assets/emscripten/emscripten-e9b1f2eed90901137ae71b1fa2427717.js.mem but the filename is still emscripten.js.mem. When I add the .mem extension to be fingerprinted in ember-cli-build.js then the path is rewritten to assets/emscripten/emscripten-93c4916db6cd46010fdec63ab09a2118.js-2de574db8bcd561db3c5f8221f2abd73.mem but the mem file is named emscripten.js-2de574db8bcd561db3c5f8221f2abd73.mem.
Right now we change the paths by hand, because adjusting the emscripten build is not that easy in our whole workflow. Would be great if there is a solution to this problem. I wanted to create some fix but I ended up at some mad regex in broccoli-asset-rewrite where I can not estimate the impact of a change. Furthermore I'm not sure if the bug really comes from there.
I want to include source map files of an external lib into my production build.
I am including the .js file dynamically in index.html. I do not want to import it with app.import(..).
So in ember-cli-build.js I am including a funnel with file name xyz.js.map.
Fingerprinting is enabled.
After ember build, the source map reference in the xyz.js to the source map file xyz.js.map has been changed to:
xyz-[hashvalue].js-[hashvalue].map
Correct would be in my opinion:
xyz.js-[hashvalue].map
I guess the hash value is appended to every match on the defined fingerprinting file extensions (e.g. ['js', 'map']?
The file extension matching should only match the extension part after the last dot. Today it seems to match every occurrence in the file/url.
I first posted this issue in Ember-Cli because I didn't know where to open this issue but after a discussion on Slack I think it better fits here. I just copy and paste it, the original issue is here (ember-cli/ember-cli#7466).
When I build an Ember app with the production flag then the
broccoli-asset-rewrite
does a wrong rewrite of my assets. In my case this happens whenbroccoli-asset-rewrite
rewrites the path to files which are generated by emscripten.In my
public
folder there is another folder which is calledassets
and there is a folderemscripten
. The build result of the emscripten is file called emscripten.js and a emscripten.js.mem file. In the emscripten.js file the path to the .mem file is specified like this:var data = {memoryInitializer: 'assets/emscripten/emscripten.js.mem'};
. After fingerprinting the path is rewritten toassets/emscripten/emscripten-e9b1f2eed90901137ae71b1fa2427717.js.mem
but the filename is stillemscripten.js.mem
. When I add the.mem
extension to be fingerprinted inember-cli-build.js
then the path is rewritten toassets/emscripten/emscripten-93c4916db6cd46010fdec63ab09a2118.js-2de574db8bcd561db3c5f8221f2abd73.mem
but the mem file is namedemscripten.js-2de574db8bcd561db3c5f8221f2abd73.mem
.Right now we change the paths by hand, because adjusting the
emscripten build
is not that easy in our whole workflow. Would be great if there is a solution to this problem. I wanted to create some fix but I ended up at some mad regex inbroccoli-asset-rewrite
where I can not estimate the impact of a change. Furthermore I'm not sure if the bug really comes from there.I created a repo which should demonstrate the issue:
https://github.com/tschoartschi/ember-cli-fingerprint-problem
To reproduce
ember build -e production
and check if the output inemscripten.js
inmemoryInitializer
has the correct path to the mem file. I created two git tags, one with the fingerprinting settings I use and one without any settings. See: https://github.com/tschoartschi/ember-cli-fingerprint-problem/releasesMaybe this issue is related to ember-cli/ember-cli#7149 because there the reporter also has the problems of two hashes in one filename
I also think this issue could be very similar to this one: #57
Maybe also related to: ember-cli/broccoli-asset-rev#94
Output from
ember version --verbose && npm --version && yarn --version
:The text was updated successfully, but these errors were encountered: