How to bundle node_modules .css and .js files?

I am using ionic scripts 1.0.0 and ionic 2.2.1

This question has been asked in this forum and stackoverflow but never clearly answered. Either the answer was related to Ionic2 beta or the answerers started discussing a different problem than the original question posed which left the original unanswered.

The newest, clearest, and closest question is here:

However there are 2 problems with the answer:
1 - The v1.0.0 app scripts copy.config.js file no longer looks as shown in the question.
2 - It doesn’t describe how to get those 3rd party node_modules .css into main.css and .js into main.js

I have added mediaelement.js to my project - npm install mediaelement - and need to reference its .js and .css files located at node_modules/mediaelement/build/. The mediaelement.css references image files which are in that same folder.

I need the .js file to be packaged into main.js and the .css file packaged into main.css.

How can I do this?

You’ll probably want to update your version of app scripts so you get to use webpack instead of rollup. This was a known issue with the old solution: