I am looking for way to modify output of build function from
ng build --prod
would like to add some bootstrap css files to head section of index.html, change name index.html => index.php etc.
how to do it ?
The hooks give you the opportunity to act on a component or directive instance at the appropriate moment, as Angular creates, updates, or destroys that instance. Each interface defines the prototype for a single hook method, whose name is the interface name prefixed with ng .
DevKit was built to provide libraries that can be used to manage, develop, deploy, and analyze your code. DevKit has a schematics-cli command line tool that you can use to create your own Schematics.
A lifecycle hook provides a specified amount of time (one hour by default) to wait for the action to complete before the instance transitions to the next state.
Angular gives us 8 hooks to allow us to tap into the lifecycle of our components and trigger actions at specific points in the lifecycle.
You can customise the implementation from the source code. This section explains how you can proceed.
In particular, you can change the following lines from addon/ng2/models/webpack-build-common.ts.
new HtmlWebpackPlugin({
template: path.resolve(projectRoot, `./${sourceDir}/index.php`),
chunksSortMode: 'dependency'
})
For the CSS resources, they can be packaged directly if you use Webpack Angular CLI.
EDIT
The key index in the apps nodes can be modified in the angular-cli.json file. The line should be changed to
"index": "index.php",
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With