mikser-io-live 3.0.0 → 5.0.0
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/README.md +12 -7
- package/index.js +13 -11
- package/package.json +22 -22
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# mikser-io-live
|
|
2
2
|
|
|
3
|
-
Live-reload dev server for [Mikser](https://github.com/almero-digital-marketing/mikser-io). Wraps [alive-server](https://
|
|
3
|
+
Live-reload dev server for [Mikser](https://github.com/almero-digital-marketing/mikser-io). Wraps [alive-server](https://www.npmjs.com/package/alive-server) and serves the configured `outputFolder`, auto-refreshing browsers as Mikser regenerates files.
|
|
4
|
+
|
|
5
|
+
The lighter alternative to `mikser --server` when all you want is "save a file → browser refreshes." Pair with `mikser --watch` for the classic SSG dev loop. If you also need API endpoints, an admin UI, or other plugins that need a shared Express app, use `mikser --server` instead.
|
|
4
6
|
|
|
5
7
|
## Install
|
|
6
8
|
|
|
@@ -12,16 +14,19 @@ npm install mikser-io-live
|
|
|
12
14
|
|
|
13
15
|
```js
|
|
14
16
|
// mikser.config.js
|
|
17
|
+
import { live } from 'mikser-io-live'
|
|
18
|
+
|
|
15
19
|
export default {
|
|
16
|
-
plugins: [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
plugins: [
|
|
21
|
+
live({
|
|
22
|
+
port: 8080,
|
|
23
|
+
open: true
|
|
24
|
+
})
|
|
25
|
+
]
|
|
21
26
|
}
|
|
22
27
|
```
|
|
23
28
|
|
|
24
|
-
The
|
|
29
|
+
The options object is passed straight through to `alive-server.start(...)`. Defaults applied by the plugin:
|
|
25
30
|
|
|
26
31
|
- `wait: 1000`
|
|
27
32
|
- `root: runtime.options.outputFolder`
|
package/index.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import liveServer from 'alive-server'
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
export function live(options = {}) {
|
|
4
|
+
return ({ onLoaded, runtime, useLogger }) => {
|
|
5
|
+
onLoaded(async () => {
|
|
6
|
+
const logger = useLogger()
|
|
7
|
+
logger.info('Starting live server')
|
|
8
|
+
liveServer.start({
|
|
9
|
+
wait: 1000,
|
|
10
|
+
root: runtime.options.outputFolder,
|
|
11
|
+
open: false,
|
|
12
|
+
...options,
|
|
13
|
+
})
|
|
12
14
|
})
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
+
}
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
2
|
+
"name": "mikser-io-live",
|
|
3
|
+
"version": "5.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/almero-digital-marketing/mikser-io-live.git"
|
|
11
|
+
},
|
|
12
|
+
"author": "",
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/almero-digital-marketing/mikser-io-live/issues"
|
|
16
|
+
},
|
|
17
|
+
"homepage": "https://github.com/almero-digital-marketing/mikser-io-live#readme",
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"mikser-io": "^9.0.0"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"alive-server": "^1.3.0"
|
|
23
|
+
}
|
|
24
24
|
}
|