refactor: standardize formatting in CSS and JS build configurations
This commit is contained in:
parent
dd0a92b69b
commit
e08549e9d6
2 changed files with 13 additions and 23 deletions
|
|
@ -25,34 +25,24 @@ const buildCss = async (inputPath, outputPaths) => {
|
|||
}
|
||||
|
||||
return result.css;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
export const buildAllCss = async () => {
|
||||
const tasks = [];
|
||||
|
||||
tasks.push(
|
||||
buildCss(
|
||||
'src/assets/css/global/global.css',
|
||||
['src/_includes/css/global.css']
|
||||
)
|
||||
);
|
||||
tasks.push(buildCss('src/assets/css/global/global.css', ['src/_includes/css/global.css']));
|
||||
|
||||
const localCssFiles = await fg(['src/assets/css/local/*.css']);
|
||||
const localCssFiles = await fg(['src/assets/css/local/**/*.css']);
|
||||
for (const inputPath of localCssFiles) {
|
||||
const baseName = path.basename(inputPath);
|
||||
tasks.push(
|
||||
buildCss(inputPath, [`src/_includes/css/${baseName}`])
|
||||
);
|
||||
tasks.push(buildCss(inputPath, [`src/_includes/css/${baseName}`]));
|
||||
}
|
||||
|
||||
const componentCssFiles = await fg(['src/assets/css/components/*.css']);
|
||||
const componentCssFiles = await fg(['src/assets/css/components/**/*.css']);
|
||||
for (const inputPath of componentCssFiles) {
|
||||
const baseName = path.basename(inputPath);
|
||||
tasks.push(
|
||||
buildCss(inputPath, [`dist/assets/css/components/${baseName}`])
|
||||
);
|
||||
tasks.push(buildCss(inputPath, [`dist/assets/css/components/${baseName}`]));
|
||||
}
|
||||
|
||||
await Promise.all(tasks);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -23,14 +23,14 @@ export const buildJs = async (inputPath, outputPath) => {
|
|||
export const buildAllJs = async () => {
|
||||
const tasks = [];
|
||||
|
||||
const inlineBundleFiles = await fg(['src/assets/scripts/bundle/*.js']);
|
||||
const inlineBundleFiles = await fg(['src/assets/scripts/bundle/**/*.js']);
|
||||
for (const inputPath of inlineBundleFiles) {
|
||||
const baseName = path.basename(inputPath);
|
||||
const outputPath = `src/_includes/scripts/${baseName}`;
|
||||
tasks.push(buildJs(inputPath, outputPath));
|
||||
}
|
||||
|
||||
const componentFiles = await fg(['src/assets/scripts/components/*.js']);
|
||||
const componentFiles = await fg(['src/assets/scripts/components/**/*.js']);
|
||||
for (const inputPath of componentFiles) {
|
||||
const baseName = path.basename(inputPath);
|
||||
const outputPath = `dist/assets/scripts/components/${baseName}`;
|
||||
|
|
|
|||
Loading…
Reference in a new issue