vaderjs 1.3.3-2124566be812 → 1.3.3-2124766be812
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 +3 -2
- package/vader.js +6 -4
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "vaderjs",
|
|
3
3
|
"description": "A Reactive library aimed to helping you build reactive applications inspired by react.js",
|
|
4
4
|
"module": "vader.js",
|
|
5
|
-
"version": "1.3.3-
|
|
5
|
+
"version": "1.3.3-2124766be812",
|
|
6
6
|
"bin": {
|
|
7
7
|
"vader": "./vader.js"
|
|
8
8
|
},
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"glob": "latest",
|
|
31
31
|
"puppeteer":"latest",
|
|
32
|
-
"dotenv":"latest"
|
|
32
|
+
"dotenv":"latest",
|
|
33
|
+
"prettier": "latest"
|
|
33
34
|
|
|
34
35
|
}
|
|
35
36
|
}
|
package/vader.js
CHANGED
|
@@ -4,6 +4,7 @@ import { glob, globSync, globStream, globStreamSync, Glob, } from 'glob'
|
|
|
4
4
|
import puppeteer from 'puppeteer';
|
|
5
5
|
import http from 'http'
|
|
6
6
|
import { WebSocketServer } from 'ws'
|
|
7
|
+
import prettier from 'prettier'
|
|
7
8
|
import { watch } from "fs";
|
|
8
9
|
import path from 'path'
|
|
9
10
|
let config = await import('file://' + process.cwd() + '/vader.config.js').then((e) => e.default || e)
|
|
@@ -32,9 +33,8 @@ if (!fs.existsSync(process.cwd() + '/dist')) {
|
|
|
32
33
|
|
|
33
34
|
|
|
34
35
|
|
|
35
|
-
if (typeof process.env.isCloudflare !== "undefined" || !fs.existsSync(process.cwd() + '/dist/index.html')) {
|
|
36
|
-
|
|
37
|
-
fs.writeFileSync(process.cwd() + "/dist/index.html", htmlFile)
|
|
36
|
+
if (typeof process.env.isCloudflare !== "undefined" || !fs.existsSync(process.cwd() + '/dist/index.html')) {
|
|
37
|
+
fs.writeFileSync(process.cwd() + "/dist/index.html", '')
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
|
|
@@ -1004,8 +1004,10 @@ async function Build() {
|
|
|
1004
1004
|
console.log(`Disabled prerendering for ${window.location.pathname}`)
|
|
1005
1005
|
}
|
|
1006
1006
|
})
|
|
1007
|
-
|
|
1007
|
+
let html = await page.content();
|
|
1008
1008
|
|
|
1009
|
+
html = await prettier.format(html, { parser: "html" })
|
|
1010
|
+
|
|
1009
1011
|
await page.close();
|
|
1010
1012
|
await writer(process.cwd() + '/dist/' + (route.url === '/' ? 'index.html' : `${route.url}/` + 'index.html'), html)
|
|
1011
1013
|
await browser.close();
|