Fix possible grammatical errors injected
This commit is contained in:
14
bin/utils/combine.ts
vendored
14
bin/utils/combine.ts
vendored
@@ -2,15 +2,17 @@ import fs from 'fs';
|
||||
|
||||
export default async function combineFiles(files: string[], output: string) {
|
||||
const contents = files.map((file) => {
|
||||
const fileContent = fs.readFileSync(file);
|
||||
if (file.endsWith('.css')) {
|
||||
return (
|
||||
"window.addEventListener('DOMContentLoaded', (_event) => { const css = `" +
|
||||
fileContent +
|
||||
"`; const style = document.createElement('style'); style.innerHTML = css; document.head.appendChild(style); });"
|
||||
);
|
||||
const fileContent = fs.readFileSync(file, 'utf-8');
|
||||
return `window.addEventListener('DOMContentLoaded', (_event) => {
|
||||
const css = ${JSON.stringify(fileContent)};
|
||||
const style = document.createElement('style');
|
||||
style.innerHTML = css;
|
||||
document.head.appendChild(style);
|
||||
});`;
|
||||
}
|
||||
|
||||
const fileContent = fs.readFileSync(file);
|
||||
return (
|
||||
"window.addEventListener('DOMContentLoaded', (_event) => { " +
|
||||
fileContent +
|
||||
|
||||
Reference in New Issue
Block a user