I'm currently upgrading an AngularJS app to an Angular app, using Angular CLI.
My problem is that when I build the app using ng build
, it would copy all the files to the dist
folder but will ignore all the AngularJS files. For all the js files, my solution was to add them to the scripts
array in the angular-cli.json
. Now, I just need to handle the html files. For the Angular app, angular cli will handle them automatically for me, but the AngularJS ones will stay outside the dist
folder. A solution I came up with, was to add them to the assets
array. So basically I have two questions:
Is there a way where I can tell angular cli to build all .html
files from a certain folder? something like that: "assets": [ "app/ng1/.*html" ]
Is this best practice? or is there a better way to achieve what I want?
Thanks!
我找到了第一个问题的解决方案:在assets
数组中,我没有使用html
文件的纯路径,而是使用了glob: { "glob": "**/*.html", "input": "./app/ng1", "output": "./app/ng1" }
同时使用**
将选择/app/ng1
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.