Exclude specific files from uglification during build


#1

Hey!

The background of my question is the following issue I opened at the ember-cli project More details to be found there. Why I’m posting here again is that I think it’s not really an issue with the ember-cli project.

The problem is that the (production) build of our app fails, because we run out of memory while building. We hit the memory limit of node.js (V8). Also raising the memory limit didn’t help us. We always get “FATAL ERROR: CALL_AND_RETRY_LAST” or a never ending script.

We traced down the problem to our emscripten files in the assets folder. They are quite big and they cause uglification to crash. Also minifying them again makes no sense. From my point of view, it would make most sense to just exclude these emscripten files from uglification. But I didn’t find any way how to achieve this. (disclaimer: I’m no broccoli or ember-cli-addon expert).

A solution which works for us is, to put our emscripten files into a directory which is unknown to ember-cli (called emscripten_components) and then copy the files manually to the desired location. This was just a quick&dirty hack to get the build working again. I’m sure there must be a better way.

Does anyone has an idea how to solve this issue in a smarter way? For me our solution feels like a huge hack. Any help, hints, tricks or tips are very well appreciated.

Thanks a lot


#2

I havent tried to modifiy the ember-cli build tools myself, but this may be what you need.

ember-cli addon hooks


#3

@dpreston: thanks for the hint. I ended up building a very hack’ish in-app-repo. It’s not a peace of software excellence but it works (which is important for us right now). If someone has tips or tricks to improve the script I’m happy to hear them. Because stefanpenner replied on github I posted my hacky solution there: more details on github