简体   繁体   中英

angular-cli build, deploy chunks on a separate server

I run 'ng build --prod' and i get 3 chunks generated, for 3 lazy loaded modules.

suppose i want to host those 3 chunks on a different webserver than the rest of the application. Is there a way in webpack to configure this ?

You will need to copy the bundled js files in a html page and host the web-page on a webserver, for eg:

<html>
<head></head>
<body>
    <div>
    I'm externally loaded angular project
     </div>

 <script src="~inline.bundle.js"></script>
 <script src="~vendor.bundle.js"></script>
 <script src="~main.bundle.js"></script>

</body>
</html>

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM