0

I am using Angular-CLI 1.0.0-beta.11-webpack.2.

There are ways to include 3rd Party Libs and css using scripts and styles tag in Angular-CLI 1.0.0-beta.11-webpack.2 build but how to include additional folders like images and data (which include some static data in json files) in build.

Location for my images and data folder is in /src/images & /src/data.

1 Answer 1

1

I believe they currently have a "public" directory that you can add items to.

The command ng build should take everything in that "public" directory and copy it over to the "dist" directory

I am looking at a similar thing right now trying to get bootstrap 4 integrated with my angular-cli app.

Rap: For anyone who stumbles across this, the folder/directory is now called "assets" and is set in angular-cli.json under the assets key. It isn't "public" any longer.

Sign up to request clarification or add additional context in comments.

7 Comments

let me know when you work it out how you have integrated bootstrap 4 in to your angular-cli app ... I dont know, I havent tried but here is some information related to what you are trying to do ... github.com/angular/angular-cli#global-library-installation
Glad to hear that worked for you microchip. I have been trying to figure that one out, but sadly I feel that it is a little buggy at the moment. Word on the street is that it worked with RC4, and now it seems that it may not be supported until they implement their add-on system, github.com/angular/angular-cli/issues/1696. I think the most straight forward workaround may be to add the jquery, tether, and bootstrap(css and js) library into the public folder. From here adding a link in the head tag of the html for each resource should do the trick.
Alright so here is an update. The angular-cli that is pulled down from npm is not the same angular-cli in the master branch on github. I removed both local and global instances of angular-cli. I then executed a npm install -g angular-cli@git+https://github.com/angular/angular-cli.git Now the global-library-installation is working properly. It is probably just a matter of time before the package is updated in npm, but this should get you working with the latest and greatest.
awesome ... this will be helpful for many like me who is working on early stage of angular-cli webpack beta ... thanks a lot
@C-man Same here, I couldn't get bootstrap to work with global styles thingy on their readme. I don't know if your solution would work but they have to let people know this isn't available yet. Very very frustrating.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.