Angular-cli: How to link custom files? Where is dist folder?

Created on 22 Aug 2016  Â·  5Comments  Â·  Source: angular/angular-cli

Hello,
I am new to angular-cli. I have 2 questions.
1.After creating a new project using ng new , the dist folder is not created. how to create it and keep it updated?
2.How to link custom files? I paste them in public folder but how to link them ? for example any css or image files?

  1. OS? Mac OSX ( El Capitan?)
  2. angular-cli: 1.0.0-beta.11-webpack.2
    node: 6.4.0
    os: darwin x64

Most helpful comment

hey @usmanwalana. The dist folder is only created when you create builds. If you run ng build you will see your dist folder with all of your public files copied into it.

All 5 comments

hey @usmanwalana. The dist folder is only created when you create builds. If you run ng build you will see your dist folder with all of your public files copied into it.

Thankyou @deebloo . I ran ng build now dist is created and my files are copied to it.
However i am still having problems linking to css files.
Please tell what path should i enter in index.html for linking css file.
I am using this tag
<link href="../dist/css/bootstrap.css" rel="stylesheet">

Create css folder in public dir, and add bootstrap.css there. Then link as css/bootstrap.css ☺

@deebloo's answer was spot on. As for global CSS, a better way was added in https://github.com/angular/angular-cli/pull/1633 and should be in the next release.

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._

Was this page helpful?
0 / 5 - 0 ratings