Commit 6c7d9632 authored by Eric Bremner's avatar Eric Bremner
Browse files

Updating gulpfile to include building pattern lab styles

parent 8eb288f1
...@@ -42,6 +42,31 @@ const compileComponentScripts = () => { ...@@ -42,6 +42,31 @@ const compileComponentScripts = () => {
const cssSrc = path.join(__dirname, '..', 'css'); const cssSrc = path.join(__dirname, '..', 'css');
const PLSrc = [
path.join(__dirname, '/source/pattern-lab.scss')
];
const compilePLStyles = () => {
return src(PLSrc)
.pipe(sassGlob())
.pipe(sourcemaps.init())
.pipe(
sass({
includePaths: ['./node_modules/breakpoint-sass/stylesheets'],
precision: 10,
})
)
.pipe(
postcss([
require('postcss-assets')(),
require('autoprefixer')({
remove: false,
}),
])
)
.pipe(dest(cssSrc));
};
const buildConfig = async() => { const buildConfig = async() => {
const scssDir = path.join(__dirname, '/source/_patterns/00-config'); const scssDir = path.join(__dirname, '/source/_patterns/00-config');
const ymlDir = path.join(__dirname, './source/_data'); const ymlDir = path.join(__dirname, './source/_data');
...@@ -211,12 +236,14 @@ const buildComponentScripts = (exports.buildScripts = series(compileComponentScr ...@@ -211,12 +236,14 @@ const buildComponentScripts = (exports.buildScripts = series(compileComponentScr
const buildStyles = (exports.buildStyles = series(lintStyles, compileStyles, minifyCSS, compileLayoutStyles, minifyLayoutsCSS)); const buildStyles = (exports.buildStyles = series(lintStyles, compileStyles, minifyCSS, compileLayoutStyles, minifyLayoutsCSS));
const buildPLStyle = (exports.buildPLStyles = series(compilePLStyles));
const build = (isProduction = true ) => { const build = (isProduction = true ) => {
const scriptTask = isProduction ? bundleScripts : bundleScriptsDev; const scriptTask = isProduction ? bundleScripts : bundleScriptsDev;
task('bundleScripts', scriptTask) task('bundleScripts', scriptTask)
return series( return series(
buildConfig, buildConfig,
parallel(task('bundleScripts'), buildStyles, buildComponentScripts, buildPatternLab)); parallel(task('bundleScripts'), buildStyles, buildComponentScripts, buildPLStyle, buildPatternLab));
} }
exports.build = build(true); exports.build = build(true);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment