These are chat archives for AngularClass/NG6-starter

13th
Jan 2016
Andrew Lombardi
@kinabalu
Jan 13 2016 02:44
anyone able to help on how to @import css that exist inside node_modules imports?
Eric McNiece
@emcniece
Jan 13 2016 04:44
@kinabalu not sure that this is the best way to do it, but I usually use gulp to compile all CSS from node_modules and bower_components into a single vendor.css file that gets placed in a web-accessible directory
can't remember what best practice for these repos is though
Andrew Lombardi
@kinabalu
Jan 13 2016 04:45
@emcniece thanks, my gulp knowledge is little to none. I guess there may be no other way to do it. care to share a gist of how you do that? They don’t use bower in this project actually
Eric McNiece
@emcniece
Jan 13 2016 04:48
*gulpfile.js
the styles block (line 29-42) handles script compilation
Andrew Lombardi
@kinabalu
Jan 13 2016 04:49
@emcniece ok thanks, will check it out
Eric McNiece
@emcniece
Jan 13 2016 04:51
31: plumber is an error handler
32: compass handles Sass scripts
37: autoprefixer will add extra lines/prefixes (-moz -webkit etc) for some browsers
38: still all of the previously parsed stuff into /html/css/
39: rename the generated files to *.min.css
40: run minification on all this
41: place final generated file in /html/css/
same thing happens for javascript files in the 45-53 block
Eric McNiece
@emcniece
Jan 13 2016 04:56
we could modify gulpfile.babel.js to also pull CSS files from node_modules and include this as a path in the let paths = { ... } block, but it kinda feels like a hack
Andrew Lombardi
@kinabalu
Jan 13 2016 04:57
well also because there’s a lot of css files that … i don’t really want
Eric McNiece
@emcniece
Jan 13 2016 04:57
yeah
so specifying a module or 2 to pull from might be ok, or even specific paths
feels wrong tho
I'm sure somebody else knows the real way to do it ;)
Andrew Lombardi
@kinabalu
Jan 13 2016 04:58
heh
i don'
i don’t know enough to care
or rather, to be able to figure it out :P
Sergey Protko
@fesor
Jan 13 2016 09:00
this is already handled by less-loader
@import ‘~bootstrap/less/main.less'
or something like this.
I prefer to use web pack to bundle my css and then use text extract plugin to get css out of js bundle