These are chat archives for AngularClass/angular2-webpack-starter

15th
Jun 2016
Sean Larkin
@TheLarkInn
Jun 15 2016 02:50
@leNicDev just use raw loader no CSS.
Also, take the 10 minutes to look at what the two loaders do in the src code. Most loaders are simply one function that takes a source and returns a new modified source. It should help you understand why you don't need to chain CSS loader to raw loader.
Jaroslaw Ivanov
@ivanovjaroslaw
Jun 15 2016 05:48

Hello! I can't understand how to inject js 3rd party libs. For example,

import * as d3 from 'd3';

So, all works fine, but when I compile this I got

[default] /app/components/app.component.ts:8:21 
    Cannot find module 'd3'.
But all works fine. Only this message is annoying me :) Can I fix this error message?
@ivanovjaroslaw ^^
Jaroslaw Ivanov
@ivanovjaroslaw
Jun 15 2016 06:08

@TheLarkInn It doens't help. I add this to vendor.ts

import 'd3';

And add this to typings.d.ts

declare let d3: any;
Jaroslaw Ivanov
@ivanovjaroslaw
Jun 15 2016 06:24

And it seems, that, when I try to

import * as d3 from 'd3';

in some specific component, d3 object is available at the global level from other components.
For example, inject d3 into c1.component.ts. Then, in c2.component.ts type something like

console.log(d3);

And it works! Awfull!

Can you help me with this? Can I inject some js 3rd party lib from node_modules into some file in the project without pollute global scope?
timathon
@timathon
Jun 15 2016 09:53
Hello. Please any one guide on how to set up the coverage reporter. When I run npm run watch:test, the coverage report only covers app/, app/about/, app/home/, app/home/x-large. How do I include other folder/files? Thanks.
timathon
@timathon
Jun 15 2016 10:39
After writing more specs, other files starting to show up in the coverage report. I just started learning how to unit test.
Nic
@leNicDev
Jun 15 2016 11:12
@TheLarkInn But raw-loader doesn't resolve paths like background-image: url('./image.png');