I'm generating dist folder after ng build and my directory looks like
C:\Source\angular> ng build
cut and past the dist folder in another directory
C:\ReSource\angularbuild
After changing in Index.html to
<base href="./ReSource/angularbuild/dist">
Then
C:\Source\angular> ng serve
Getting inline.bundle.js,main.bundle.js,styles.bundle.js,vendor.bundle.js,main.bundle.js 404 not found errors
How could i achieve it ? I want to run the dist folder which is placed in angularbuild folder from C:\Source\angular>
Let me know the right way to do it.
The dist folder is the build folder which contains all the files and folders which can be hosted in the server. The dist folder contains the compiled code of your angular application in the format of JavaScript and also the required HTML and CSS files.
Syntax. ng build command compiles an angular application/library into an output directory named dist at given path.
After ng build, it just needs a server to execute it, instead of ng serve you can install an http-server from your terminal npm i -g http-server --save
then execute your project from the dist folder using the command (y) :
http-server ./dist
Or on apache for who are using Wamp or Xamp for example just copy the entire files on the dist folder inside your www folder, then restart Apache service
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