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) {
|
export default async function combineFiles(files: string[], output: string) {
|
||||||
const contents = files.map((file) => {
|
const contents = files.map((file) => {
|
||||||
const fileContent = fs.readFileSync(file);
|
|
||||||
if (file.endsWith('.css')) {
|
if (file.endsWith('.css')) {
|
||||||
return (
|
const fileContent = fs.readFileSync(file, 'utf-8');
|
||||||
"window.addEventListener('DOMContentLoaded', (_event) => { const css = `" +
|
return `window.addEventListener('DOMContentLoaded', (_event) => {
|
||||||
fileContent +
|
const css = ${JSON.stringify(fileContent)};
|
||||||
"`; const style = document.createElement('style'); style.innerHTML = css; document.head.appendChild(style); });"
|
const style = document.createElement('style');
|
||||||
);
|
style.innerHTML = css;
|
||||||
|
document.head.appendChild(style);
|
||||||
|
});`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const fileContent = fs.readFileSync(file);
|
||||||
return (
|
return (
|
||||||
"window.addEventListener('DOMContentLoaded', (_event) => { " +
|
"window.addEventListener('DOMContentLoaded', (_event) => { " +
|
||||||
fileContent +
|
fileContent +
|
||||||
|
|||||||
Reference in New Issue
Block a user