kiss-ssg 1.4.2 → 1.4.4
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/examples/5-helpers.js +1 -0
- package/kiss-serve.js +5 -3
- package/kiss-ssg.js +2 -1
- package/package.json +1 -1
package/examples/5-helpers.js
CHANGED
package/kiss-serve.js
CHANGED
|
@@ -4,8 +4,10 @@ const static = require('serve-static')
|
|
|
4
4
|
const colors = require('colors')
|
|
5
5
|
const app = connect()
|
|
6
6
|
|
|
7
|
-
module.exports = async (httpRoot) => {
|
|
7
|
+
module.exports = async (httpRoot, port) => {
|
|
8
8
|
if (!httpRoot) httpRoot = '/public'
|
|
9
|
+
if (!port) port = 3000
|
|
10
|
+
|
|
9
11
|
app.use(function (req, res, next) {
|
|
10
12
|
console.log(req.url)
|
|
11
13
|
next()
|
|
@@ -26,9 +28,9 @@ module.exports = async (httpRoot) => {
|
|
|
26
28
|
|
|
27
29
|
console.log(
|
|
28
30
|
`Serving (${httpRoot}): `.grey,
|
|
29
|
-
colors.yellow('http://localhost:
|
|
31
|
+
colors.yellow('http://localhost:' + port)
|
|
30
32
|
)
|
|
31
|
-
app.listen(
|
|
33
|
+
app.listen(port)
|
|
32
34
|
|
|
33
35
|
const livereload = require('livereload')
|
|
34
36
|
const server = livereload.createServer()
|
package/kiss-ssg.js
CHANGED
|
@@ -344,6 +344,7 @@ class Kiss {
|
|
|
344
344
|
sass: {
|
|
345
345
|
includePaths: [],
|
|
346
346
|
},
|
|
347
|
+
port: 3001,
|
|
347
348
|
},
|
|
348
349
|
...config,
|
|
349
350
|
}
|
|
@@ -364,7 +365,7 @@ class Kiss {
|
|
|
364
365
|
const kissServe = require('./kiss-serve')
|
|
365
366
|
var publicDir = path.resolve(this.config.folders.build)
|
|
366
367
|
try {
|
|
367
|
-
kissServe(publicDir)
|
|
368
|
+
kissServe(publicDir, this.config.port)
|
|
368
369
|
} catch (error) {
|
|
369
370
|
console.error('Error running live reload server'.red)
|
|
370
371
|
console.log(error.message)
|