vaderjs 1.3.3-alpha-65 → 1.3.3-alpha-66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/vader.js +1 -4
package/package.json
CHANGED
package/vader.js
CHANGED
|
@@ -652,10 +652,7 @@ function Compiler(func, file) {
|
|
|
652
652
|
let html = fs.existsSync(process.cwd() + '/dist/index.html') ? fs.readFileSync(process.cwd() + '/dist/index.html', 'utf8') : ''
|
|
653
653
|
if (!html.includes(`<link rel="preload" href="${path.replace(/'/g, '').trim()}" as="${path.replace(/'/g, '').trim().includes('.css') ? 'style' : 'script'}">`)
|
|
654
654
|
&& !path.includes('.module.css')
|
|
655
|
-
) {
|
|
656
|
-
if (!html.includes(`</head>`)) {
|
|
657
|
-
throw new Error('Could not find </head> in index.html')
|
|
658
|
-
}
|
|
655
|
+
) {
|
|
659
656
|
let preload = `${!path.trim().includes('.css') ? `<link rel="modulepreload" href="${path.trim()}">` : ''}<link rel="preload" href="${path.trim()}" as="${path.trim().includes('.css') ? 'style' : 'script'}">`
|
|
660
657
|
html = html.replace('</head>', `${preload}\n</head>`)
|
|
661
658
|
|