mikser-io-live 3.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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +34 -0
  3. package/index.js +14 -0
  4. package/package.json +24 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Almero Digital Marketing
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # mikser-io-live
2
+
3
+ Live-reload dev server for [Mikser](https://github.com/almero-digital-marketing/mikser-io). Wraps [alive-server](https://github.com/davidmoshal/alive-server) and serves the configured `outputFolder`, auto-refreshing browsers as Mikser regenerates files.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install mikser-io-live
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```js
14
+ // mikser.config.js
15
+ export default {
16
+ plugins: ['live'],
17
+ live: {
18
+ port: 8080,
19
+ open: true
20
+ }
21
+ }
22
+ ```
23
+
24
+ The `live` config object is passed straight through to `alive-server.start(...)`. Defaults applied by the plugin:
25
+
26
+ - `wait: 1000`
27
+ - `root: runtime.options.outputFolder`
28
+ - `open: false`
29
+
30
+ Pair with Mikser's watch mode to get a live-reloading dev loop.
31
+
32
+ ## License
33
+
34
+ MIT
package/index.js ADDED
@@ -0,0 +1,14 @@
1
+ import liveServer from 'alive-server'
2
+
3
+ export default ({ onLoaded, runtime, useLogger }) => {
4
+ onLoaded(async () => {
5
+ const logger = useLogger()
6
+ logger.info('Starting live server')
7
+ liveServer.start({
8
+ wait: 1000,
9
+ root: runtime.options.outputFolder,
10
+ open: false,
11
+ ...runtime.config.live,
12
+ })
13
+ })
14
+ }
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "mikser-io-live",
3
+ "version": "3.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": "^6.0.0"
20
+ },
21
+ "dependencies": {
22
+ "alive-server": "^1.3.0"
23
+ }
24
+ }