diff --git a/packages/htmlpack/src/index.ts b/packages/htmlpack/src/index.ts index 7f1e82cb8..aa760b202 100644 --- a/packages/htmlpack/src/index.ts +++ b/packages/htmlpack/src/index.ts @@ -87,6 +87,7 @@ const processLinkTag = (baseDir: string, _name: string, attrs: any): string => { if (!href) return null; const filePath = `${baseDir}/${href}`; + const content = fs.readFileSync(filePath, 'utf8'); return ``; }; @@ -95,8 +96,26 @@ const processScriptTag = (baseDir: string, _name: string, attrs: any): string => const src = attrValue(attrs, 'src'); if (!src) return null; - const content = fs.readFileSync(`${baseDir}/${src}`, 'utf8'); - return ``; + const scriptFilePath = `${baseDir}/${src}`; + let content = fs.readFileSync(scriptFilePath, 'utf8'); + + // There's no simple way to insert arbitrary content in ` or `