Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng build fails to copy .htaccess, and possibly other similarly named files, to the output #1758

Closed
NgxDev opened this issue Aug 19, 2016 · 5 comments
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix

Comments

@NgxDev
Copy link

NgxDev commented Aug 19, 2016

.htaccess file from public folder isn't copied over to dist on ng build

angular-cli: 1.0.0-beta.11-webpack.2
node: 6.4.0
os: win32 x64
@hansl
Copy link
Contributor

hansl commented Aug 19, 2016

@TheLarkInn Are you not copying dot files over?

@hansl hansl added this to the 1.0-final milestone Aug 19, 2016
@filipesilva filipesilva added type: bug/fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Aug 23, 2016
@NgxDev
Copy link
Author

NgxDev commented Aug 30, 2016

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.

angular-cli: 1.0.0-beta.11-webpack.8
node: 6.4.0
os: win32 x64

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)

@chateaux
Copy link

chateaux commented 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:

  1. Commit to github
  2. Jenkins is notified and pulls the code (obviously not develop code)
  3. Jenkins compiles the code for distribution (ng build --prod --aot)
  4. Jenkins copies to the dist folder all my required files (htaccess, robots, etc.)
  5. Jenkins scp's a tar of the dist to my server.
  6. 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.

@gigmaps
Copy link

gigmaps commented 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
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants