Although this question is a little bit outdated, I stumbled with the same issue in Angular CLI 7 and 8.
According to Angular documentation you could use '--resourceOutputPath' and '--deployUrl'. Unfortunately --resourceOutputPath only works for assets defined in stylesheet and '--deployUrl' doesn't put the assets in a folder.
My current solution is:
- set the 'baseHref' option in the build config to '/static-files/'
- copy the index.html file from the output folder and put it 1 folder up.
Now you end with a structure like
/dist
index.html
/static-files
chunk1.js
chunk2.js
etc
Of course now all your assets are in a separate folder and not only your js files. But it works for me.
Note: when you also using the Angular Routing, you need to set the 'APP_BASE_HREF' manual because otherwise the router is looking for 'staric-files' in your url (https://angular.io/api/common/APP_BASE_HREF)