Hey @simonsmith,
I am trying to @import files using glob and postcss-easy-import but I'm having trouble setting my import directory to something other than process.cwd(). Here is my Gulp task:
var paths = {
styles: 'src/**/*--suit.css'
};
gulp.task('compile:css', function() {
return gulp.src(paths.styles)
.pipe(changedInPlace({ firstPass: true }))
.pipe(print(function(filepath) { return "Compiled " + "'" + filepath + "'"; }))
.pipe(suitcss({
root: 'src',
'postcss-easy-import': {
glob: true
},
'postcss-calc': { precision: 0 },
stylelint: {
extends: 'stylelint-config-suitcss',
rules: {
'at-rule-empty-line-before': [ 'always',
{ 'ignore': [ 'all-nested', 'blockless-after-same-name-blockless' ] }
]
}
}
}
))
.pipe(rename(function(path){
path.dirname += '/../';
path.basename = path.basename.replace(/--suit/, '');
return path
}))
.pipe(gulp.dest('src'));
});
In my css file, I have the following @import statement:
@import "/**/theme-switcher";
However, this results in an empty output file. But, if I change the import statement to:
@import "../../../**/theme-switcher";
The output file is compiled correctly. This confuses me since I've set root: 'src'. What am I missing!?
Also worth noting, once I set the postcss-easy-import option glob: true I'm unable to import suitcss components from the node_modules directory. For example, the following @import statements do not work as I expected:
@import "../../../**/suitcss-base";
@import "../../../**/suitcss-utils-text";
Any ideas?
Thanks,
Billy
Hey @simonsmith,
I am trying to
@importfiles using glob andpostcss-easy-importbut I'm having trouble setting my import directory to something other thanprocess.cwd(). Here is my Gulp task:In my
cssfile, I have the following@importstatement:However, this results in an empty output file. But, if I change the import statement to:
The output file is compiled correctly. This confuses me since I've set
root: 'src'. What am I missing!?Also worth noting, once I set the
postcss-easy-importoptionglob: trueI'm unable to importsuitcsscomponents from thenode_modulesdirectory. For example, the following@importstatements do not work as I expected:Any ideas?
Thanks,
Billy