- https://medium.com/code-sketch/how-to-deploy-an-angular-7-app-to-github-pages-9427b609645f
- https://www.youtube.com/watch?v=wElk1W1BJ2o (VVI)
- https://stackoverflow.com/questions/53698413/angular-6-build-failed-to-load-resources
command need to follow
npm install -g angular-cli-ghpages
🌹 ng build --prod --base-href https://[username].github.io/[repo]/
🌹 ngh --dir=dist/[project-name]
You need to change
<base href="/"> to <base href="./">
ng build ngx-datagrid-test --prod --base-href https://tusharghoshbd.github.io/ngx-datagrid
ngh --dir=dist/ngx-datagrid-test
some important commands use for angular
ng build [project_name] // for library ex "ng build ngx-datatable"
ng build [project_name] --prod //here project name option and only build js file in dist folder
ng serve [project_name] --prod // here project name option and run server in production mode
Can't load angular generated webpage (ng build --prod)
The problem is you're trying to run the application without a server serving the js bundles generated by Angular. Angular will load the js asynchronously.
An option run
live-server on the compiled directory// Install live-server if you haven't
npm install -g live-server
// Run live-server on you dist
cd <project-compile-dist-path>
live-server
// Note: if you don't want to install live-server globally you
// can use npx
npx live-server <path-to-directory>
https://stackoverflow.com/questions/58878123/cant-load-angular-generated-webpage-ng-build-prod
No comments:
Post a Comment