-
Notifications
You must be signed in to change notification settings - Fork 12k
How to add external libs to webpack.2 , angular-cli 1.0.0-beta11 #1668
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
Comments
you need to do a "import * as charts from 'charts'" or similar somewhere in your code for webpack to pick it up. don't add it to index.html for styles - you'll have to 'require()' them or put them into index.html. |
@reflog Can you expand on the two styles options? |
|
The I'm getting the following error:
|
That was an example, just add your library name.. On Fri, Aug 12, 2016, 18:43 LunicLynx [email protected] wrote:
|
I know, i tried it with that lib just to make sure it's not an issue with my lib. |
It seems that the libs need to full fill some kind of requirement too to work in that way. |
Um it does not work i can confirm, also i am talking about the angular 2 implementation of chartjs which can be found here "http://valor-software.com/ng2-charts" which says the following
any insight? |
@pitops are you using typescript? |
@LunicLynx yes! |
If you upgrade to |
I know that too. I Even fixed the typescript error, but then I get the same error from webpack. Which makes sense because webpack is not interested in typings. But anyway I probably missed something. Sent from my iPhone
|
@adamduren um the difference with my situation is that the part where i reference the script directly from the index.html file it is not loaded, the npm install part does work and gets imported fine. |
if using webpack, then pretty much all libraries should be able to be included with a simple |
The two parts of this problem are being tracked separately:
I'd like to add that @iamyojimbo's suggestion is really good. We're doing some testing and it might be what we recommend in the README. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Mac OSX El Capitan
ng --version
. If there's nothing outputted, please runin a Terminal:
node --version
and paste the result here:1.0.0-beta.11-webpack.2
do on your code? etc.
I am trying to add charts.js to angular 2 RC5. But after doing npm installs and referencing the script directly into index.html like this
<script src="node_modules/chart.js/dist/Chart.bundle.min.js"></script>it does not get picked up and gives error of not found in console. What is the way to load external scripts in newest version?
more information.
The text was updated successfully, but these errors were encountered: