How setting up and organizing ionic with require.js

I would like to know how to configure the dependencies placed in the default header to download using ionic npm , that order should wear and how to organize the new files to be added

structur folder

Was set up but fails to organize the shim

is not whether routes are the folders that are wrong , but I think it’s wrong settings of the shim

<script src="lib/require/require.js" data-main="lib/main">