Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Skip minifying files if we aren't building for
// production and debug is enabled
if( config.dev.debug.styles && ! isProd ) {
postcssPlugins.pop();
}
// Report messages from other postcss plugins
postcssPlugins.push(
reporter({ clearReportedMessages: true })
);
// Return a single stream containing all the
// after replacement functionality
return pipeline.obj([
gulpPlugins.postcss([
AtImport({
path: [paths.styles.srcDir],
plugins: [
stylelint(),
]
})
]),
gulpPlugins.postcss(postcssPlugins),
gulpPlugins.if(
config.dev.debug.styles,
gulpPlugins.tabify(2, true)
),
gulpPlugins.rename({
suffix: '.min'
}),
server.stream({match: "**/*.css"}),
]);
// Skip minifying files if we aren't building for
// production and debug is enabled
if( config.dev.debug.styles && ! isProd ) {
postcssPlugins.pop();
}
// Report messages from other postcss plugins
postcssPlugins.push(
reporter({ clearReportedMessages: true })
);
// Return a single stream containing all the
// after replacement functionality
return pipeline.obj([
gulpPlugins.postcss([
AtImport({
path: [paths.styles.srcDir],
plugins: [
stylelint(),
]
})
]),
gulpPlugins.postcss(postcssPlugins),
gulpPlugins.if(
config.dev.debug.styles,
gulpPlugins.tabify(2, true)
),
gulpPlugins.rename({
suffix: '.min'
}),
server.stream({match: "**/*.css"}),
]);
describe('extract', () => {
test('basic')
test('blacklist', ['*.global.css'])
test('composes')
test('optimize')
test('plugins', [], atImport())
})
function css() {
var plugins = [
postcssImport(),
precss(),
autoprefixer({
path: ["src/public/css"]
}),
cssnano()
];
return gulp
.src(paths.styles.src)
.pipe(sourcemaps.init())
.pipe(postcss(plugins))
.pipe(sourcemaps.write())
.pipe(gulp.dest(paths.styles.dest));
}
function css() {
var plugins = [
postcssImport(),
precss(),
autoprefixer({
path: ["src/public/css"]
}),
cssnano()
];
return gulp
.src(paths.styles.src)
.pipe(sourcemaps.init())
.pipe(postcss(plugins))
.pipe(sourcemaps.write())
.pipe(gulp.dest(paths.styles.dest));
}
function css() {
var plugins = [
postcssImport(),
precss(),
autoprefixer({
path: ["src/css"]
}),
cssnano()
];
return gulp
.src(paths.styles.src)
.pipe(sourcemaps.init())
.pipe(postcss(plugins))
.pipe(sourcemaps.write())
.pipe(gulp.dest(paths.styles.dest));
}
postcss: function plugins(bundler) {
return [
postcss({ addDependencyTo: bundler }),
precss(),
];
},
};
export async function styles() {
return gulp
.src('./src/clien*/styles/*.css', {
sourcemaps: true,
})
.pipe(postcss([
cssImport(),
cssNext(),
cssNano({
autoprefixer: false,
}),
]))
.pipe(gulp.dest('dist', {
sourcemaps: '.',
}));
}
function getPostCssPlugins(keepName) {
return [
postcssImport(),
postcssSmartAsset({
url: "copy",
useHash: true,
keepName
})
]
}