angular/angular-cli

How specify a folder for javascript and css with "ng build" (but with index.html on the root folder)

cesco69 opened this issue · 3 comments

Command

build

Description

I want take index.html on the root folder, but all js and css file in a sub folder (eg: "/static").

/
├── index.html
└── static/
    ├── runtime.09dbad26989ed44c.js
    ├── polyfills.7eddfc827f8797ce.js
    ├── main.b575f9ab98e16fd7.js
    └── styles.d518ebbd15507a10.css

and index.html become

<!DOCTYPE html>
<html lang="en"> 
    <head>
        <link rel="stylesheet" href="static/styles.d518ebbd15507a10.css">
    </head>
    <body>
        <ac-root></ac-root>
        <script src="static/runtime.09dbad26989ed44c.js" type="module"></script>
        <script src="static/polyfills.7eddfc827f8797ce.js" type="module"></script>
        <script src="static/main.b575f9ab98e16fd7.js" type="module"></script>
    </body>
</html>

how do that?

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

You can use the deployUrl option to facilitate this use case when performing production builds. In this case with a value of static/. Once the production build is complete with this option enabled, the relevant files can be deployed to the needed locations or can be served as appropriate depending on the server and/or hosting services used for the application.