Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const buildAdminCss = function buildAdminCss() {
const copyStream = merge(
gulp.src(upath.joinSafe(nodeModulesPath, 'semantic-ui-css/themes/**/*'))
.pipe(gulp.dest(upath.joinSafe(adminRootPath, 'css/themes'))),
);
const cssStream = gulp.src(paths.admin.css, { base: './' })
.pipe(gulpif(options.sourcemaps, sourcemaps.init()))
.pipe(concat('css-files.css'));
const sassStream = gulp.src(paths.admin.sass, { base: './' })
.pipe(gulpif(options.sourcemaps, sourcemaps.init()))
.pipe(sass())
.pipe(concat('sass-files.scss'));
return merge(
copyStream,
merge(cssStream, sassStream)
.pipe(order(['css-files.css', 'sass-files.scss']))
.pipe(concat('style.css'))
.pipe(concat('css-files.css'));
const sassStream = gulp.src(paths.admin.sass, { base: './' })
.pipe(gulpif(options.sourcemaps, sourcemaps.init()))
.pipe(sass())
.pipe(concat('sass-files.scss'));
return merge(
copyStream,
merge(cssStream, sassStream)
.pipe(order(['css-files.css', 'sass-files.scss']))
.pipe(concat('style.css'))
.pipe(gulpif(options.minify, uglifycss()))
.pipe(gulpif(options.sourcemaps, sourcemaps.mapSources(mapSourcePath)))
.pipe(gulpif(options.sourcemaps, sourcemaps.write('./')))
.pipe(gulp.dest(upath.joinSafe(adminRootPath, 'css')))
.pipe(livereload()),
);
};
buildAdminCss.description = 'Build admin css assets.';
shop: {
js: [
upath.joinSafe(vendorUiPath, 'Resources/private/js/**'),
upath.joinSafe(vendorShopPath, 'Resources/private/js/**'),
],
sass: [
upath.joinSafe(vendorUiPath, 'Resources/private/sass/**'),
upath.joinSafe(vendorShopPath, 'Resources/private/sass/**'),
],
css: [
upath.joinSafe(nodeModulesPath, 'semantic-ui-css/semantic.min.css'),
upath.joinSafe(nodeModulesPath, 'lightbox2/dist/css/lightbox.min.css'),
upath.joinSafe(nodeModulesPath, 'slick-carousel/slick/slick.css'),
upath.joinSafe(vendorUiPath, 'Resources/private/css/**'),
upath.joinSafe(vendorShopPath, 'Resources/private/css/**'),
upath.joinSafe(vendorShopPath, 'Resources/private/scss/**'),
],
img: [
upath.joinSafe(vendorUiPath, 'Resources/private/img/**'),
upath.joinSafe(vendorShopPath, 'Resources/private/img/**'),
],
},
};
const sourcePathMap = [
{
sourceDir: upath.relative('', upath.joinSafe(vendorShopPath, 'Resources/private')),
destPath: '/SyliusShopBundle/',
},
{
sourceDir: upath.relative('', upath.joinSafe(vendorUiPath, 'Resources/private')),
destPath: '/SyliusUiBundle/',
const mapSourcePath = function mapSourcePath(sourcePath) {
const match = sourcePathMap.find(({ sourceDir }) => (
sourcePath.substring(0, sourceDir.length) === sourceDir
));
if (!match) {
return sourcePath;
}
const { sourceDir, destPath } = match;
return upath.joinSafe(destPath, sourcePath.substring(sourceDir.length));
};
alias: {
'sylius/ui': upath.relative('', upath.joinSafe(vendorUiPath, 'Resources/private/js')),
},
}],
['transform-object-rest-spread', {
useBuiltIns: false,
}],
],
}),
options.minify && uglify(),
],
treeshake: false,
});
await bundle.write({
file: upath.joinSafe(shopRootPath, 'js/app.js'),
format: 'iife',
sourcemap: options.sourcemaps,
});
};
buildShopJs.description = 'Build shop js assets.';
function getRealPath(fromPath, packagePath, relativeToDir) {
const fullPath = path.join(relativeToDir ? path.joinSafe(packagePath, relativeToDir) : packagePath, fromPath);
const pathWithExt = ensurePathHasExtension(fullPath);
return pathWithExt ? { path: fromPath, source: pathWithExt } : undefined;
}
js: [
upath.joinSafe(vendorUiPath, 'Resources/private/js/**'),
upath.joinSafe(adminPath, 'js/**'),
],
sass: [
upath.joinSafe(vendorUiPath, 'Resources/private/sass/**'),
upath.joinSafe(adminPath, 'sass/**'),
],
css: [
upath.joinSafe(nodeModulesPath, 'semantic-ui-css/semantic.min.css'),
upath.joinSafe(vendorUiPath, 'Resources/private/css/**'),
upath.joinSafe(adminPath, 'css/**'),
],
img: [
upath.joinSafe(vendorUiPath, 'Resources/private/img/**'),
upath.joinSafe(adminPath, 'img/**'),
],
},
};
const sourcePathMap = [
{
sourceDir: upath.relative('', upath.joinSafe(adminPath, '/')),
destPath: '/SyliusAdminBundle',
},
{
sourceDir: upath.relative('', upath.joinSafe(vendorUiPath, '/')),
destPath: '/SyliusUiBundle',
},
{
sourceDir: upath.relative('', nodeModulesPath),
destPath: '/node_modules',
admin: {
js: [
upath.joinSafe(vendorUiPath, 'Resources/private/js/**'),
upath.joinSafe(adminPath, 'js/**'),
],
sass: [
upath.joinSafe(vendorUiPath, 'Resources/private/sass/**'),
upath.joinSafe(adminPath, 'sass/**'),
],
css: [
upath.joinSafe(nodeModulesPath, 'semantic-ui-css/semantic.min.css'),
upath.joinSafe(vendorUiPath, 'Resources/private/css/**'),
upath.joinSafe(adminPath, 'css/**'),
],
img: [
upath.joinSafe(vendorUiPath, 'Resources/private/img/**'),
upath.joinSafe(adminPath, 'img/**'),
],
},
};
const sourcePathMap = [
{
sourceDir: upath.relative('', upath.joinSafe(adminPath, '/')),
destPath: '/SyliusAdminBundle',
},
{
sourceDir: upath.relative('', upath.joinSafe(vendorUiPath, '/')),
destPath: '/SyliusUiBundle',
},
{
sourceDir: upath.relative('', nodeModulesPath),
const rootPath = upath.normalizeSafe(argv.rootPath);
const adminRootPath = upath.joinSafe(rootPath, 'admin');
const vendorPath = upath.normalizeSafe(argv.vendorPath || '.');
const vendorAdminPath = vendorPath === '.' ? '.' : upath.joinSafe(vendorPath, 'AdminBundle');
const vendorUiPath = vendorPath === '.' ? '../UiBundle/' : upath.joinSafe(vendorPath, 'UiBundle');
const nodeModulesPath = upath.normalizeSafe(argv.nodeModulesPath);
const paths = {
admin: {
js: [
upath.joinSafe(vendorUiPath, 'Resources/private/js/**'),
upath.joinSafe(vendorAdminPath, 'Resources/private/js/**'),
],
sass: [
upath.joinSafe(vendorUiPath, 'Resources/private/sass/**'),
upath.joinSafe(vendorAdminPath, 'Resources/private/sass/**'),
],
css: [
upath.joinSafe(nodeModulesPath, 'semantic-ui-css/semantic.min.css'),
upath.joinSafe(vendorUiPath, 'Resources/private/css/**'),
upath.joinSafe(vendorAdminPath, 'Resources/private/css/**'),
],
img: [
upath.joinSafe(vendorUiPath, 'Resources/private/img/**'),
upath.joinSafe(vendorAdminPath, 'Resources/private/img/**'),
],
},
};
const sourcePathMap = [
{
const nodeModulesPath = upath.normalizeSafe(argv.nodeModulesPath);
const paths = {
shop: {
js: [
upath.joinSafe(vendorUiPath, 'Resources/private/js/**'),
upath.joinSafe(vendorShopPath, 'Resources/private/js/**'),
],
sass: [
upath.joinSafe(vendorUiPath, 'Resources/private/sass/**'),
upath.joinSafe(vendorShopPath, 'Resources/private/sass/**'),
],
css: [
upath.joinSafe(nodeModulesPath, 'semantic-ui-css/semantic.min.css'),
upath.joinSafe(nodeModulesPath, 'lightbox2/dist/css/lightbox.min.css'),
upath.joinSafe(nodeModulesPath, 'slick-carousel/slick/slick.css'),
upath.joinSafe(vendorUiPath, 'Resources/private/css/**'),
upath.joinSafe(vendorShopPath, 'Resources/private/css/**'),
upath.joinSafe(vendorShopPath, 'Resources/private/scss/**'),
],
img: [
upath.joinSafe(vendorUiPath, 'Resources/private/img/**'),
upath.joinSafe(vendorShopPath, 'Resources/private/img/**'),
],
},
};
const sourcePathMap = [
{
sourceDir: upath.relative('', upath.joinSafe(vendorShopPath, 'Resources/private')),
destPath: '/SyliusShopBundle/',
},