You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ng build fails to copy .htaccess, and possibly other similarly named files, to the output #1758
My .htaccess file from the public folder still isn't being copied over to dist on build.
In addition to that, now any file from the public folder isn't copied, not just .dot files.
EDIT: Hmmm... I've just ng new a new app instead of ng init on an old one. And I see that there is no public folder anymore.
But now... I have no place to put my .htaccess. If I put it in src directly, it still isn't copied over. And assets is no place for .htaccess file - it needs to be in the root directory (my case is just about .htaccess, but maybe other files would also need that).
Now, with public gone, I don't know where to put files that we might need to be copied over to dist (the root of dist, not in other subfolders of dist)
I was having this issue as well and then I realised that I am just being stupid.
I was initially running the build process manually and copying a zip of the distribution to the server and unzipping it. Prior to the zip I would copy any other files I needed into the distribution.
This is/was a pain to do.
However, once I have completed testing something, it gets moved into a git/jenkins scenario which makes life very simple.
This is my workflow:
Commit to github
Jenkins is notified and pulls the code (obviously not develop code)
Jenkins compiles the code for distribution (ng build --prod --aot)
Jenkins copies to the dist folder all my required files (htaccess, robots, etc.)
Jenkins scp's a tar of the dist to my server.
Jenkins deletes server files and untars the new environment.
Takes at most two minutes from start to end and to initiate the process is pretty much a: git push upstream master from my local command line.
Ideally I would like a method to include the files via ng-cli settings... however, there are simple solutions when you put your mind to it.
Activity
hansl commentedon Aug 19, 2016
@TheLarkInn Are you not copying dot files over?
fix(build): copy dot files in assets
NgxDev commentedon Aug 30, 2016
My
.htaccessfile from thepublicfolder still isn't being copied over todiston build.In addition to that, now any file from the
publicfolder isn't copied, not just.dotfiles.EDIT: Hmmm... I've just
ng newa new app instead ofng initon an old one. And I see that there is nopublicfolder anymore.But now... I have no place to put my
.htaccess. If I put it insrcdirectly, it still isn't copied over. Andassetsis no place for.htaccessfile - it needs to be in the root directory (my case is just about.htaccess, but maybe other files would also need that).Now, with
publicgone, I don't know where to put files that we might need to be copied over todist(the root ofdist, not in other subfolders ofdist)chateaux commentedon Mar 23, 2017
I was having this issue as well and then I realised that I am just being stupid.
I was initially running the build process manually and copying a zip of the distribution to the server and unzipping it. Prior to the zip I would copy any other files I needed into the distribution.
This is/was a pain to do.
However, once I have completed testing something, it gets moved into a git/jenkins scenario which makes life very simple.
This is my workflow:
Takes at most two minutes from start to end and to initiate the process is pretty much a: git push upstream master from my local command line.
Ideally I would like a method to include the files via ng-cli settings... however, there are simple solutions when you put your mind to it.
gigmaps commentedon Mar 28, 2017
to anyone reading this old thread (as it's the first link showing on a search)
the solution is here:
#4607
angular-automatic-lock-bot commentedon Sep 6, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.