Skip to content

Commit

Permalink
issue: #1478; vite.config.ts update;
Browse files Browse the repository at this point in the history
  • Loading branch information
migbash committed Aug 1, 2023
1 parent 8461f3c commit 398bb09
Showing 1 changed file with 26 additions and 21 deletions.
47 changes: 26 additions & 21 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,29 +62,34 @@ export default defineConfig
(
cssCode,
options
) =>
): string =>
{

// ### NOTE:
// ### the 'cssCode' generated contains some 'formatting' issues.
// ### remove 1st and last speech marks.
// ### remove cases of `\n` chars.
// ### correct custom case of 'ids'/'classes' using the 'forward-slash' in the declaration.
let cssCodeMod: string = cssCode.slice(1, -1);
cssCodeMod = cssCodeMod.replace(/\\n/g, "");
cssCodeMod = cssCodeMod.replace(/\\\\/g,"\\")

// ### WARNING:
// ### 'all-css-chunk.css' must exist inside '/static'
fs.writeFile
(
'./static/all-css-chunk.css',
cssCodeMod,
err =>
{
if (err) console.error(err);
}
);
const generateOneCssFile: boolean = false;

if (generateOneCssFile)
{
// ### NOTE:
// ### the 'cssCode' generated contains some 'formatting' issues.
// ### remove 1st and last speech marks.
// ### remove cases of `\n` chars.
// ### correct custom case of 'ids'/'classes' using the 'forward-slash' in the declaration.
let cssCodeMod: string = cssCode.slice(1, -1);
cssCodeMod = cssCodeMod.replace(/\\n/g, "");
cssCodeMod = cssCodeMod.replace(/\\\\/g,"\\")

// ### WARNING:
// ### 'all-css-chunk.css' must exist inside '/static'
fs.writeFile
(
'./static/all-css-chunk.css',
cssCodeMod,
err =>
{
if (err) console.error(err);
}
);
}

return '';

Expand Down

0 comments on commit 398bb09

Please sign in to comment.